Can someone tell me what this means? I keep getting this error on a couple lines. (Will bold to let you know which ones) I would really appreciate it. Thanks!
error C2064: term does not evaluate to a function taking 1 arguments
Code:
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
double NohalfDollars;
double Noquarters;
double Nodimes;
double Nonickels;
double Nopennies;
#define half .50
#define quarter .25
#define dime .10
#define nickle .05
#define penny .01
#define MAX 5
void display_menu();
char get_choice();
void option_A();
void option_B();
void main()
{
char choice;
do
{
display_menu();
choice = get_choice();
switch(choice)
{
case 'A':
option_A();
break;
case 'B':
option_B();
break;
}
} while(choice != 'C');
}
void display_menu()
{
system("cls");
printf("\n~~Select one of the following options~~\n\n");
printf("A-------Option A-The Magic Number!\n");
printf("B-------Option B-Counting Change!\n");
printf("C-------Quit\n");
}
char get_choice()
{
char ch;
do
{
ch = toupper(_getch());
} while (!strchr("ABC",ch));
return ch;
}
void option_A()
{
int magic,
guess,
tries = 0;
srand( (unsigned)time( NULL ) );
magic = rand()%MAX;
system("cls");
printf("\n\nGuess the random number from 0 to %d\n\n",MAX);
do
{
printf("guess: ");
scanf_s("%d",&guess);
if(guess == magic)
{
printf("** Right **");
printf("%d is the magic number\n", magic);
}
else
if (guess > magic)
printf(".. Wrong .. Too High\n");
else
printf(".. Wrong .. Too Low\n");
tries++;
} while(guess != magic);
printf("You took %d tries.\n", tries);
printf("\n\n\n\nPress any key to return to the main menu!");
_getch();
}
void option_B()
{ int Nickels=0;
int Half=0;
int Quarters=0;
int Dimes=0;
int Pennies=0;
int Total =0;
double sum =0;
printf("Enter pennies amount: \n");
scanf_s("%d",&Pennies);
printf("Enter quarters amount: \n");
scanf_s("%d",&Quarters);
printf("Enter dimes amount: \n");
scanf_s("%d",&Dimes);
printf("Enter nickels amount: \n");
scanf_s("%d",&Nickels);
printf("Enter half dollar amount: \n");
scanf_s("%d",&Half);
printf ("You have entered %d Half Dollars for: $%.2f ",Half,NohalfDollars(Half));
printf ("\nYou have entered %d Quarters for: $%.2f ",Quarters,Noquarters(Quarters));
printf ("\nYou have entered %d Dimes for: $%.2f ",Dimes,Nodimes(Dimes));
printf ("\nYou have entered %d Nickles for: $%.2f ",Nickels,Nonickels(Nickels));
printf ("\nYou have entered %d Pennies for: $%.2f ",Pennies,Nopennies(Pennies));
Total=Half+Quarters+Dimes+Nickels+Pennies;
sum=NohalfDollars(Half)+Noquarters(Quarters)+Nodimes(Dimes)+Nonickels(Nickels)+Nopennies(Pennies);
printf ("\nYou have entered %d coins worth a total of : $%.2f ",Total,sum);
printf ("\n\n\nPress Any Key to Return to the Main Menu ..... ");
_getch();
}