Design a grade average program that will produce the numerical grade average of
ID: 3629888 • Letter: D
Question
Design a grade average program that will produce the numerical grade average of test scores input by a user.Your program 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.
An example of the pseudo code my school is using:
Example
Class WriteArray
main()
num ArrayLength = 3
num MyArray[ArrayLength] = 2, 4, 6
num index = 1
while index <= ArrayLength
output MyArray[index]
index = index + 1
endWhile
return
input someVariableName
Explanation / Answer
please rate - thanks
class averageGrades
main()
num ArrayLength = 5
num MyArray[ArrayLength]
num index = 1
num sum=0
while index <= ArrayLength
MyArray[index]=0
index = index + 1
endWhile
index=1
input MyArray[index]
while MyArray[index]>=0
sum=MyArray[index]+sum
input MyArray[index]
endWhile
average=sum/(index-1)
output average
return
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.