If statement/While Loop

Write your question here.
First of all. If I'm being overly newbie and this may have been asked. I searched for it, but had difficult with wording efficiency, so feel free to redirect if this is the case.

For a project in class (super new, so be dumb for me), we have to have a program which calculates GPA. The previous project was for 4 classes exactly, so I used if statements and had no problem. THIS assignment has to be for a user entering an arbitrary amount of classes then calculate the GPA using while loops and if statements. I understand using them in error checking, but I'm confused on the arbitrary number of variables aspect.

My question is how to make it so they say they're taking 7 classes then the program asks for 7 different entries to be computed. Or 6 and the program asks for 6. I'm not looking for someone to just do my homework for me, I just can't wrap my head around this one. I hope my word vomit is comprehensible.

Thanks in advance!
closed account (48T7M4Gy)
http://www.cplusplus.com/doc/tutorial/control/

set limit to 7
set number of students = 0

if number of students < limit
input marks

etc etc
increment number by 1
loop
Last edited on
Topic archived. No new replies allowed.