Code:
char askQuestion(char fish, char chips, char drinks)
{
char y='y';
char n='n';
y=toupper(y);
n=toupper(n);
char wantfish = askQuestion ("Do you want fish?(y/n)");
scanf(" %c", &fish);
char wantchips = askQuestion ("Do you want chips?(y/n)");
scanf(" %c", &chips);
char wantdrinks = askQuestion ("Do you want drinks?(y/n)");
scanf(" %c", &drinks);
return fish;
return chips;
return drinks;
}
so I ran the program using this, but the question's never came up nor did the option for me to choose.
this is my whole code so far:
Code:
int main(void)
{
displayMenu();
return 1;
}
void displayMenu()
{
printf(" Welcome to Sunny FISH & CHIPS! \n");
printf(" FOODS: \n");
printf(" -----------_ \n");
printf(" Fish: Haddock (K) Large(L) $5.00 | Halibut (T) Large(L) $4.00\n");
printf(" Chips: Cut(C) Large(L) $2.00 | Ring(R) Large(L) $3.00\n");
printf(" ----------- \n");
printf(" DRINKS: \n");
printf(" ----------- \n");
printf(" Drinks: Soft Drink(S) Large(L) $2.00 | Coffee(C) Large(L) $1.75\n");
printf(" Tea(T) Large(L) $1.50 \n");
printf("--------------------------------------------------------------------\n");
printf(" Note: Price for Medium Sizes are 80%% of the large price\n");
printf(" Price for Small Sizes are 60%% of the large price\n");
printf("--------------------------------------------------------------------\n");
}
char askQuestion(char fish, char chips, char drinks)
{
char y='y';
char n='n';
y=toupper(y);
n=toupper(n);
char wantfish = askQuestion ("Do you want fish?(y/n)");
scanf(" %c", &fish);
char wantchips = askQuestion ("Do you want chips?(y/n)");
scanf(" %c", &chips);
char wantdrinks = askQuestion ("Do you want drinks?(y/n)");
scanf(" %c", &drinks);
return fish;
return chips;
return drinks;
}