Hello
My first post here on this board and I would need some help/suggestion
How can I get the total price of 2 orders ? For example, if I choose cheesburger and sprite ?
Code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
system("COLOR F4");
int choixMenu;
float a = 3.75;
float b = 4.2;
float c = 2.1;
float d = 5.2;
float e = 3.79;
printf("--- Menu ---\n\n");
printf("1. Burger\n");
printf("2. Kebab\n");
printf("3. Cheeseburger\n");
printf("4. Big Mac\n");
printf("5. Fish burger\n");
printf("\n Your choice ? ");
scanf("%d", &choixMenu);
printf("\n");
system("cls");
switch (choixMenu)
{
case 1:
printf("You have chosen Burger, the price is %f \n", a);
break;
case 2:
printf("You have chosen Kebab, the price is %f \n", b);
break;
case 3:
printf("You have chosen Cheeseburger, the price is %f !\n", c);
break;
case 4:
printf("You have chosen Big Mac, the price is %f !\n", d);
break;
case 5:
printf("You have chosen Fish Burger, the price is %f \n\n", e);
default:
printf("You have chosen wrong number!");
break;
}
printf("\n What would you like to drink ?\n");
int choixMenu1;
float f = 1.75;
float g = 2.2;
float h = 1.9;
float i = 1.75;
float j = 2.7;
printf("=== Menu Drink ===\n\n");
printf("6. Sprite\n");
printf("7. CocaCola\n");
printf("8. Tea\n");
printf("9. Water\n");
printf("10. Bier\n");
printf("\nYour choice ? ");
scanf("%d", &choixMenu1);
printf("\n");
switch (choixMenu1)
{
case 6:
printf("You have chosen Sprite, the price for Sprite is %f euro\n", f);
break;
case 7:
printf("You have chosen CocaCola, the price is %f euro\n", g);
break;
case 8:
printf("You have chosen Tea, the price is %f euro\n", h);
break;
case 9:
printf("You have chosen water, the price is %f euro !\n", i);
break;
case 10:
printf("You have chosen bier, the price is %f euro \n\n", j);
default:
printf("You sellected wrong number !");
break;
}
return 0;
}