Professional Documents
Culture Documents
CH 3 DEBUG and Flowchart Problems - Attempt Review
CH 3 DEBUG and Flowchart Problems - Attempt Review
start
Declarations
string name
num hours
num rate
num DEDUCTION = 45
num gross
num net
input name
input rate
endif
input name
endwhile
https://moodle.lsua.edu/mod/quiz/review.php?attempt=1518465&cmid=1008399 1/5
2/4/24, 11:00 PM Ch 3 DEBUG and Flowchart Problems: Attempt review
stop
Question 2
Place these two lines in the code below.
Correct
output "Enter first score or 0 to quit "
1.00 points out input firstTest
of 1.00
Flag question
// This pseudocode is intended to determine whether students have
// passed or failed a course;
student needs to average 60 or
// more on two tests.
start
Declarations
num firstTest
num secondTest
num average
num PASSING = 60
while firstTest not equal to 0
output "Enter first score or 0 to quit "
input firstTest
output "Enter second score"
input secondTest
average = (firstTest + secondTest) / 2
ouput "Average is ", average
if average >= PASSING then
output "Pass"
else
output "Fail"
endif
endwhile
stop
Select one:
a. No changes are necessary.
c.
The lines are needed before the while statement and before the
endwhile statement.
e.
https://moodle.lsua.edu/mod/quiz/review.php?attempt=1518465&cmid=1008399 2/5
2/4/24, 11:00 PM Ch 3 DEBUG and Flowchart Problems: Attempt review
Question 3 What is wrong with the following flowchart? A is the priming input. B is a selection.
Correct C is the main processing. More than one answer may apply.
1.00 points out
of 1.00
Flag question
e. Another rectangle with A should follow the Yes selection of B, but before C.
Question 4
1. Which structure does the following pseudocode represent? loop
Correct
else
do theOtherProcess
endif
Question 5
1. This picture depicts a single alternative selection structure.
Correct
Flag question
https://moodle.lsua.edu/mod/quiz/review.php?attempt=1518465&cmid=1008399 4/5
2/4/24, 11:00 PM Ch 3 DEBUG and Flowchart Problems: Attempt review
Question 6
Correct
1.00 points out A selection structure contains a test, and, depending on the result,
of 1.00
Flag question
branches, but does not repeat. An example is when you change lanes going to the
In a sequence structure, the tasks are executed one at a time in order, with
A loop structure contains a test, but repeats tasks over and over until
the condition of the test is met. An example is when you circle the airport until your
friend arrives.
https://moodle.lsua.edu/mod/quiz/review.php?attempt=1518465&cmid=1008399 5/5