printf("\n Enter the quantity of your choices:");
printf("\n Set Meal 1? ");
scanf("%d", &set1_qty);
printf("\n Set Meal 2? ");
scanf("%d", &set2_qty);
printf("\n Set Meal 3? ");
scanf("%d", &set3_qty);
printf("\n Set Meal 4? ");
scanf("%d", &set4_qty);
printf("\n Set Meal 5? ");
scanf("%d", &set5_qty);
printf("\n Set Meal 6? ");
scanf("%d", &set6_qty);
int fastfood(int code = 1)
{
int ff_option, alacarte_option, set_option;
float total_set_price, total_alacarte_price, discount_rate,discount, GSTax, total_meal_price, total_amount, amount;
ffmainmenu:
system ("cls");
printf("\n Fastfood Ordering System");
printf("\n*************************************");
printf("\n Select an options:");
printf("\n 1. Sets Meal");
printf("\n 2. Ala Carte");
printf("\n\n Options : ");
scanf("%d", &ff_option);
switch (ff_option)
{
case 1:
total_set_price = set (ff_option = 1);
printf("\n Would you like to order some add-ons?");
printf("\n 1. Yes");
printf("\n 2. No\n Decision: ");
scanf("%d", &alacarte_option);
case 2:
total_alacarte_price = alacarte (ff_option = 2);
printf("\n Would you like to order some set meals?");
printf("\n 1. Yes");
printf("\n 2. No\n Decision: ");
scanf("%d", &set_option);
if (set_option == 1)
{
total_set_price = set ( set_option = 1);
}
else
{
total_set_price = 0.00;
}
when the program is in this format, it's working. However, when it contains some sequence error. the program suppose to prompt a user choice to choose whether fastfood ordering or etc. when user choose fastfood ordering, they still have to make choice between set meals and ala carte order. Now, my problem is when user choose to have a set meals, it call the set meal function, but at the end, it will prompt for user choice whether to have some add-ons or not. if user choose no for it, it still link to the alacarte function instead of showing the result. besides, if user enter 0 in all the variables prompted in ala carte function, the payment result shows 0. Can anyone help me to have a look between the linking?
In addition, when i move the set and alacarte function below the fastfood function, it will have linking error (LNK2019) and sometimes error for redefinition of parameter. Can anyone explain and tell me what is the correction for it?
thank you very much.