I have to write a program that asks the user for a grade between 0 - 100 infinitely, once the user inputs the number "-1" it takes all of that data and gives the highest grade number along with the average.
I'm having trouble getting it to repeat the question and I'm puzzled as to how to store and calculate all of that data when it's completely random.
This is what I've come up with so far
#include <iostream>
using namespace std;
int main(){
int num;
cout<<"To get final and highest score, enter -1."<<endl;
cout<<"Enter the score for student 1: ";
cin>>num;
while (num < 0 || num > 100){
cout<<"Wrong. You must enter a number between 0 to 100.\n";
cin>>num;
}
if (true){
cout<<"Enter the grade for student 2: ";
cin>>num;
}
return 0;
}