Sep 29, 2012 at 4:36pm UTC
Sometimes it's the little things...
int main(); //what's wrong here ?
Sep 29, 2012 at 5:40pm UTC
yea i just saw that but i still get build errors
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()
{
int score;
cout << "enter score below to see your result:\n" ;
cin >> score;
if (score < 0) {
cout << "not a legal score!\n\n" ;
}else if (score >= 0 && score < 100) {
cout << "not much to brag about.\n\n" ;
}else if (score >= 100 && score < 500) {
cout << "good job!\n\n" ;
}else if (score >= 500 && score < 1000) {
cout << "Really good score!\n\n" ;
}else (score >= 1000) {
cout << "Awesome score!\n\n" ;
}
system("pause" );
return 0;
}
Last edited on Sep 29, 2012 at 5:40pm UTC
Sep 29, 2012 at 5:59pm UTC
it says now missing ';' before '{' ?
Sep 29, 2012 at 6:32pm UTC
I'm not sure why, but if i add an 'if' at the last 'else' then it works. so try writing:
else if (score >= 1000) {
cout << "Awesome score!\n\n";
}
it should work.