IN PSUEDOCODE
PSUEDOCODE
PSUEDOCODE
PSUEDOCODE
Write a program to calculate 10 students’ average test scores and the grade. (You will ask the user to input all students and their grades).
You may assume the following input data:
Jack Johnson 85 83 77 91 76
Lisa Aniston 80 90 95 93 48
Andy Cooper 78 81 11 90 73
Ravi Gupta 92 83 30 69 87
Bonny Blair 23 45 96 38 59
Danny Clark 60 85 45 39 67
Samantha Kennedy 77 31 52 74 83
Robin Bronson 93 94 89 77 97
Sun Xie 79 85 28 93 82
Kiran Patel 85 72 49 75 63
First Name Last Name Test1 Test2 Test3 Test4 Test5 Average Grade
Jack Johnson 85.00 83.00 77.00 91.00 76.00 82.40 B
Lisa Aniston 80.00 90.00 95.00 93.00 48.00 81.20 B
Andy Cooper 78.00 81.00 11.00 90.00 73.00 66.60 D
Ravi Gupta 92.00 83.00 30.00 69.00 87.00 72.20 C
Bonny Blair 23.00 45.00 96.00 38.00 59.00 52.20 F
Danny Clark 60.00 85.00 45.00 39.00 67.00 59.20 F
Samantha Kennedy 77.00 31.00 52.00 74.00 83.00 63.40 D
Robin Bronson 93.00 94.00 89.00 77.00 97.00 90.00 A
Sun Xie 79.00 85.00 28.00 93.00 82.00 73.40 C
Kiran Patel 85.00 72.00 49.00 75.00 63.00 68.80 D
Class Average = 70.94
Pseudocode:
1) Start the program
2) Create a class named Test with fields like firstName, lastName, mark1,mark2,mark3,mark4,mrk5, avg,grade,sum.
3) Create a object for each student and assign values.
4) sum=mark1+mark2+mark3+mark4+mark5;
5) avg=sum/5;
6) Use if condition to assign grades.
7) Add it to the arrays one by one objects.
8) Declare a variable classaverage=0;
9) Iterate the array values and update the average values to the class average variable and finally divide it by the total array objects.
classAverage+=avg;
After iteration while printing or outside loop.
classAverage=classAverage/array.count;
10) Print all items in array with desired format and class average.
Please rate it if the above solution helps you in any way or if you have any concerns comment it, I will help you through again
Get Answers For Free
Most questions answered within 1 hours.