How do I run a loop based on the user input?
Example:
I ask how many students does the user want to calculate the grade.
if the user enters 2 students, then I will ask the user to input grades for exams, homework, quiz etc...
After the program calculate the first student grade, how do I run the loop again for the second student?
I tried using a while loop but it just goes to infinite loop.
What I did was:
cout << "number of student you want to calculate grade for" << endl;
cin >> student;
while (student) {
...
...
...
...
}
when I run this it goes to infinite loop.