Jump to content

Man I need some help with this pseudocode assigment....

- - - - -

  • Please log in to reply
1 reply to this topic

#1
devilnewt

devilnewt

    Newbie

  • Members
  • Pip
  • 4 posts
Ok this is what I have to accomplish:


Design a grade average program that will produce the numerical grade average of test scores input by a user.

Your program design should contain the following:
• You must use an Array as your data structure to store the input grades
• You must use a Looping structure to initialize the elements of your array to clear out system garbage.
• The user may input up to 5 test scores. Hint: This does not mean each user will input 5 scores. 3 scores may be entered for calculation.
• You must use a Looping structure to traverse the elements of your array to produce your calculation.

You are to submit, as a Microsoft Word Document, the following for this assignment:

Flowchart
Pseudocode

this is what I have so far, but it just isn't clicking in my head how to get the array and loops to mesh.

class GradeAverageProgram

main()


main()
//Declarations
num tests [testCount]
num index = 1
num sum = 0
num testCount
num score


output “Welcome to the Grade Average Program”


output “Enter up to 5 test scores ”
input testCount
while index <= maxGrades
count[index] = 0
index = index + 1
endWhile

index = 1
output “Please a test grade: ”
input tests[index]
while tests[index] >= 0
sum = tests[index] + sum
output “Please enter another test grade: ”
input count[index]
endWhile

average = sum/(index - 1)
output “You grade average is: ” average

return
endClass


Any suggestions?

#2
fread

fread

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 787 posts
At a glance:

MaxGrades in not initialized. count[] is not declared
while tests[index] >= 0
              sum = tests[index] + sum
           output “Please enter another test grade: ”
                     input count[index]
endWhile
You keep overwriting position 1 in your count[]. Increment index
Perfection of means and confusion of ends seem to characterize our age. Albert Einstein :confused:




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users