Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need help degugging the below. Can you please help? // This pseudocode is inte

ID: 3846568 • Letter: I

Question

I need help degugging the below. Can you please help?

// 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
    //you cannot do this until you get first input

       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

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote