Discover answers to your most pressing questions at Westonci.ca, the ultimate Q&A platform that connects you with expert solutions. Connect with a community of professionals ready to help you find accurate solutions to your questions quickly and efficiently. Explore comprehensive solutions to your questions from knowledgeable professionals across various fields on our platform.

// This pseudocode segment is intended to compute and display
// the average grade of three tests for any number of students.
// The program executes until the user enters a negative value
// for the first test score.
start
Declarations
num test1
num test2
num test3
num average
housekeeping()
while test1 >= 0
mainLoop()
endwhile
endOfJob()
stop

housekeeping()
output "Enter score for test 1 or a negative number to quit"
return

mainLoop()
output "Enter score for test 2"
input test2
average = (test1 + test2 + test3) / 3
output "Average is ", average
output "Enter score for test 1 or a negative number to quit"
input tesst1
return

endOfJob()
output "End of program"
return

Sagot :

The pseudocode to calculate the average of the test scores until the user enters a negative input serves as a prototype of the actual program

The errors in the pseudocode

The errors in the pseudocode include:

  • Inclusion of unusable segments
  • Incorrect variables
  • Incorrect loops

The correct pseudocode

The correct pseudocode where all errors are corrected and the unusable segments are removed is as follows:

start

Declarations

     num test1

     num test2

     num test3

     num average

output "Enter score for test 1 or a negative number to quit"

input test1

while test1 >= 0

     output "Enter score for test 2"

     input test2

     output "Enter score for test 3"

     input test3

     average = (test1 + test2 + test3) / 3

     output "Average is ", average

     output "Enter score for test 1 or a negative number to quit"

     input test1

endwhile

output "End of program"

stop

Read more about pseudocodes at:

https://brainly.com/question/11623795