What should my For Loop say?

Can someone help me write this program in c++?

 Suppose a teacher weights the four exams he gives 10%, 25%, 30%, and 35%.
Write a program that reads ten sets of four grades, prints the weighted average of each set, and prints the unweighted average of each test. The number of students should be in a global constant.

I know I need to use a for loop, but I'm not sure how to write it. Can someone show me how to code this along with guiding me through the code?
Kammy San NicolasAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ste5anSenior DeveloperCommented:
How should you read those then sets?
How would you store it?
0
sarabandeCommented:
as it is 4 exams and 10 students you need two loops. an outer loop for the exams and an inner loop for the students and their grades

for (int e = 0; e < NUM_EXAM; ++e)
{
        ....
        for (int s = 0; s < NUM_STUDENT; ++s)
        {
                ....

Open in new window


you could define the constants as const int above the loops.

you also could exchange the outer and inner loop (what doesn't make much difference for your program logic).

try to find out what kind of arrays you need to store the weights and the 4 times 10 grades you get as input.

Sara
1
Kammy San NicolasAuthor Commented:
Thanks Sara. That helped clear things up a bit for me
0
sarabandeCommented:
if you are stuck you may post what you have so far and ask for help either with a compile error or simply how to proceed.

Sara
1
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.