what errors are you getting? I see a couple of missing semicolons -- your compiler should complain about them. Look at the errors, then look at your code and see if you can figure out what's wrong.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
That error means the program is attempting to pass the wrong number of parameters. how many parameters to you see in that function? It doesn't have any parameters, yet your program is attempting to pass one parameter -- they have to be consistent.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
i dont understand
Read your own program. That function has no parameters.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
You better read about local variables, glodabl variables, and passing arguments to functions.
Here is a corrected version.
#include <iostream>
using namespace std;
// This program takes the numerical score and outputs a letter grade.//
int getScore ()
{[INDENT]int count;
int score,
cout << "\nEnter the student's score: "<< endl;
cin >> score
cout <<"\nThe score is/are: " << score << endl;
return score;[/INDENT]}
int printGrade( int grade)
{[INDENT]if ( grade >= 90)[INDENT]cout <<"\nYour grade is A." << endl;[/INDENT]else if (grade >= 80 )[INDENT]cout <<"\nYour grade is B." << endl;[/INDENT]else if (grade >= 70 )[INDENT]cout <<"\nYour grade is C." << endl;[/INDENT]else if (grade >= 60 )[INDENT]cout <<"\nYour grade is D." << endl;[/INDENT]else[INDENT]cout <<"\nYour grade is F." << endl;[/INDENT]return 0;[/INDENT]}
int main ()
{[INDENT]for ( int i = 0 ; i < 10 ; i++ )
{[INDENT]int num = getScore ();
printGrade(num);[/INDENT]}
return 0;[/INDENT]}
WolfPack
Postaholic
2,051 posts since Jun 2005
Reputation Points: 572
Solved Threads: 115