Please complete the Find the Bugs exercise #1 from page 123 of the text book. Us
ID: 671951 • Letter: P
Question
Please complete the Find the Bugs exercise #1 from page 123 of the text book. Using a word processor, such as MS Word, make changes to the given pseudocode. Using a highlight feature (or change the font color) of your changes.
Debug03-01:
// This pseudocode is intended to determine whether students have
// passed or failed a course based on the average score of two
// tests. Student needs 60 average or better to pass.
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
Explanation / Answer
start
Declarations
num firstTest
num secondTest
num average
num PASSING = 60
output "Enter first score or 0 to quit"
input firstTest
while firstTest not equal to 0
output "Enter second score"
input secondTest
average = (firstTest + secondTest) / 2
output "Average is ", average
if average >= PASSING then
output "PASS"
else
output "Fail"
endif
output "Enter first score or 0 to quit"
input firstTest
endwhile
stop
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.