I tried writing code for this question but i always getting this error. please let me know what i am doing wrong. here is question, code, and the error.
Write a program that calculates the total grade for N classroom exercises as a percentage. The user to input the value for N followed by each of the N scores and totals. Calculate the overall percentage (sum of the total points earned divided by the total point possible) and output it as a percentage. Sample input and output it as a percentage. Sample input and output is shown below.
How many exercises to input?
score1: 10
total points possible: 10
score2: 7
total points possible: 12
score3: 5
total points possible: 8
code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
# include <iostream>
using namespace std;
int main ()
{
double N=0, score, total, totalScore=0, totalGrade=0, GRADE;
cout<<"How many excersices will be scored?/n";
cin>>N;
for(int n=1; n>N ; n++)
{
cout<<"Enter score # "<<n<<"/n";
cin>>score;
cout<<"Enter the max total for score # "<<n<<"/n";
cin>>total;
totalScore = totalScore + score;
totalGrade = totalGrade + total;
}
GRADE = (totalScore/totalGrade)*100;
cout<<"Your total is "<<totalScore<<" out of "<<totalGrade<<" /n";
cout<<", or "<<GRADE<<"%./n";
return 0;
}
|
error:
1>------ Build started: Project: HOMEWORK5, Configuration: Debug Win32 ------
1>LINK : error LNK2001: unresolved external symbol _mainCRTStartup
1>C:\Users\WORK\HOMEWORK5\Debug\HOMEWO… : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========