Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Design an algorithm that will use two parallel arrays to obtain user input of st

ID: 3728426 • Letter: D

Question

Design an algorithm that will use two parallel arrays to obtain user input of student name and their final numeric grade, such as the one below. Allow the user to input as many student names and final numeric grades as they prefer (until they want to quit). Once the user is done inputting their values, output every student’s name and their letter grade [90-100 is A, 80-89 is B, 70-79 is C, 60-69 is D, 59 or below is F]. Finally, calculate the class average and output the class average numeric grade; and then output all of the student’s names that are performing below the class average.

Explanation / Answer

The algorithm would be

count=0;
while(true)
{
if(input is q)
quit
else
{
input name;
input grade;
count=count+1
}
}
double avg=0
for i=0 to count
{
print name[i] grade[i]
if(grade[i] is A)
avg=avg+100
else if grade[i] is B
avg=avg+89
else if grade[i] is C
avg=avg+79
else if grade[i] is D
avg=avg+69
else if grade[i] is F
avg=avg+59
avg=avg/count;
if(avg>89)
avGrade=A
else if avg>79
avgrade=B
else if avg>69
avGrade=C
else if >59
avGrade=D
else
avGrade=F
}
print avg avGrade
for i=0 to count
{
if grade[i] <avGrade
print name and grade
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote