Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Argh! What am I missing??? Function does not take 3 arugments

Status
Not open for further replies.

Tiffc0922

Technical User
Mar 27, 2014
15
0
0
US
I'm racking my brain to figure this out.. I know its something simple but I need a new set of eyes to figure out what I'm missing?

I'm getting an error C2660: 'drillOneProblem' : function does not take 3 arguments. Help Please!

[highlight #FCE94F]line is highlighted below[/highlight]

// Drill into problem
void drillOneProblem()
{
int c, r1, r2; // passed-in parameters
int CorAns; // correct answer
int reply; // user's answer

// Ask first part of question and display first random number
cout << "\nWhat is " << r1;

// Display sign based on user's answer
switch (c)
{
case '1': cout << " + ";
CorAns = r1 + r2;
break;
case '2': cout << " - ";
CorAns = r1 - r2;
break;
case '3': cout << " * ";
CorAns = r1 * r2;
break;
}
// Finish question and display second random number
// Ask answer, validate answer and display message
cout << r2 << " ? ";
cin >> reply;
if (reply == CorAns)
{
cout << "Yes, that is corret. Good job!";
}
else
cout << "No, the correct answer is: " << CorAns << endl << endl;
}

int main()
{
int c; // user's menu choice
int r1, r2; // random numbers

//Display Menu
displayMenu();

// Get user's choice and validate if out of range
c = getMenuChoice();

// Continue with program if user doesn't quit
while (c >= 1 && c < SENT)
{
// Generate random numbers
Gen2Rand(r1, r2);

// Display question based on user's menu choice request answer and validate answer.
// Display message to show if correct or not correct. If not correct display correct answer
[highlight #FCE94F]drillOneProblem(c, r1, r2);[/highlight]
// display menu again and ask for menu choice after problem has been processed, repeat until user quits
displayMenu();
c = getMenuChoice();
} return 0;
}

Tiffany
 
Change
Code:
void drillOneProblem()
{
int c, r1, r2; // passed-in parameters
to
Code:
void drillOneProblem(int c, int r1, int r2)
{
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top