This my first C++ programming class and I'm not that good with C++, so please help me out. This is due in 4 hours. This is what i got and i got a lot of errors. Thank you and once again please help me.
1.Repeatedly reads a student score (for exam) and adds it to a running sum. Count the number of scores entered. (assume score are between 0-100) Stop when the user enters a negative number. Display the sum and count of the score onscreen.
#include <iostream>
using namespace std;
int main(){
int score, sum, count;
while(score<= 100 && score >=0){
cout << “enter a score:” ;
cin >> score;
count = 0;
count++;
sum= 0+score;
}
cout << sum;
cout<<count;
return 0;
}
2.
Defines a function "average" that, when passed the su of the scores and the count of the scores, computes and returns the average score. In main, call this function just after the above loop in problem 1, and display onscreen the average score that the function returns.
#include <iostream>
using namespace std;
average(X,Y);
int main(){
int score, sum, count;
while(score<= 100 && score >=0){
cout << “enter a score:” ;
cin >> score;
count = 0;
count++;
sum= 0+score;
}
cout << sum;
cout<<count;
return 0;
}
average(SUM, COUNT){
return sum/count;
}