Front-end week Pre-Christmas sale
Christmas are almost here! Get up to 20 % extra points for free! More info
Save up to 80 % on HTML & CSS + JavaScript e-learning! Only this week!

Discussion: Functions C++ - Error in the output of my code

Activities (2)
Avatar
JensenBreck
Member
Avatar
JensenBreck:12/13/2017 5:05

Hello,
I was assigned this question:
A Class of 40 students has received their grades for 5 exams (each out of 100). Write a structured C++ program (using top-down design) that will do the following:
Write function readData which reads the student data list which consist of the Student ID
Write function printAvg that prints the ID and average score for each student for 5 consecutive grades. Do the necessary validation on input.
Write a function worstAvg that calculates the worst average grade.
Write a function that prints the IDs of all students having the worst average grade
I wrote the code and it runs, however it calculates the average grade of each student wrong and I can't figure out why. Is it the for loop? Could someone please have a look at the code and tell me what I'm missing.

Please help.
Thanks,

I didn't find the right solution from the Internet.

References:http://www.cplusplus.com/…eral/226683/

Startup Marketing Examples

 
Reply 12/13/2017 5:05
To maintain the quality of discussion, we only allow registered members to comment. Sign in. If you're new, Sign up, it's free.

1 messages from 1 displayed.