I am trying to learn how to pseudocode. Could you please check my work and see if this is the correct way to develop a pseudo-code?
The problem is this:
"Write a program to ask the user for a series of test scores of students. The compute and print the test scores arithmetic mean for each student"
Here is my Pseudo-Code:
prompt user for studentNum
prompt for testNum
start while loop to collect data: while (i < studentNum)
3.1 ask for studentName
3.2 set sum to zero
3.3 start second nested while loop while (j < testNum)
3.3.1. ask user for the testScore
3.3.2. collect data using sum variable.
3.4 compute average by dividing sum by testNum
3.5 display data in the format:
"For " << studentName << "The average test score was: " << average
Thank you
This still looks a little too much like real code to me. There's no point in being too specific, you might as well write real code.
Instead of while i < studentNum
, say repeat studentNum times
.
Instead of output in the format ... << ... <<
, say Display output like: For John Doe, average was 75.0.
Edit: here is full pseudocode that I would write:
n
, the number of studentst
, the number of tests per studentFor John Doe, average was 75.0