Professional Documents
Culture Documents
Mini Project Code
Mini Project Code
h>
#include <stdlib.h>
void opener();
void menu();
void order();
void western();
void japan();
void korean();
void dessert();
void western_order();
void japan_order();
void korean_order();
void dessert_order();
void payment();
char name[];
int choice;
int sets;
float sum_1;
float sum_2;
float sum_3;
float sum_4;
int main()
{
opener();
switch (choice){
case 1:
menu();
case 2:
order();
break;
case 3:
printf("Thank You for the visit\n");
break;
return 0;
}
void opener(){
printf("------------------------------------------------------------------\
n");
printf(" HI WELCOME TO MEALS 4 LIFE
\n");
printf("------------------------------------------------------------------\
n");
}
void menu(){
western();
japan();
korean();
dessert();
}
void western(){
printf("\n-------------------Western-----------------------------\n\
n");
printf("W1 French Rack of Lamb [RM25]\n");
printf("W2 Carabinero Brillante (Scarlet Prawn with Japanese Rice)
[RM20]\n");
printf("W3 Spanish Sea Cucumber [RM12]\n");
printf("W4 Chicken Chop with Black Pepper Sauce [RM19]\n");
printf("W5 Fish and Chip (with Mushroom Soup) [RM19]\n");
}
void japan(){
printf("\n------------------Japanese-----------------------------\n\
n");
printf("J1 Iberico Gyozas (Dumplings) [RM10]\n");
printf("J2 Madai Fish Head [RM20]\n");
printf("J3 Sweet Corn (White Corn with Yuzu Kosho Butter) [RM10]\n");
printf("J4 Japanese Oyster Omelette [RM12]\n");
printf("J5 Eggplant and Nagaimo [RM12]\n");
}
void korean(){
printf("\n-------------------Korean------------------------------\n\
n");
printf("K1 Kimchi (Chili Pickled Cabbage) [RM15]\n");
printf("K2 Soft Tofu Stew [RM12]\n");
printf("K3 Fried Sweet Potato Noodles [RM18]\n");
printf("K4 Octopus Mixed Plate [RM18]\n");
printf("K5 Gimbap (Sushi Rice) and Baby Potato [RM15]\n");
}
void dessert(){
printf("\n------------------Dessert------------------------------\n\
n");
printf("D1 Marjolaine (Almond-chocolate sponge cake) [RM25]\n");
printf("D2 Hokkaido Ice Cream [RM15]\n");
printf("D3 Burnt Cheesecake [RM19]\n");
printf("D4 Baked Apple [RM18]\n");
printf("D5 Mung Bean Pancake [RM15\n");
}
void order(){
int food;
int i;
int count;
printf("\nPlease enter your name: ");
scanf("%s", name);
printf("\nHi %s may i take your order: \n", name);
printf("1. Western\n");
printf("2. Japanese\n");
printf("3. Korean\n");
printf("4. Dessert\n");
printf("5. Main menu\n");
printf("Enter your option: ");
scanf("%d", &food);
switch (choice){
case 1:
total_1 = 25.00 * sets;
break;
case 2:
total_1 = 20.00 * sets;
break;
case 3:
total_1 = 12.00 * sets;
break;
case 4:
total_1 = 19.00 * sets;
break;
case 5:
total_1 = 19.00 * sets;
}
sum_1 += total_1;
}
void japan_order(){
float total_2;
total_2 = 0;
sum_2 = 0;
japan();
printf("Enter your choice : J");
scanf("%d", &choice);
printf("\nHow many sets do you want ?:");
scanf("%d", &sets);
switch (choice){
case 1:
total_2 = 10.00 * sets;
break;
case 2:
total_2 = 20.00 * sets;
break;
case 3:
total_2 = 10.00 * sets;
break;
case 4:
total_2 = 12.00 * sets;
break;
case 5:
total_2 = 12.00 * sets;
}
sum_2 += total_2;
}
void korean_order(){
float total_3;
total_3 = 0;
sum_3 = 0;
korean();
printf("Enter your choice : K");
scanf("%d", &choice);
printf("\nHow many sets do you want ?:");
scanf("%d", &sets);
switch (choice){
case 1:
total_3 = 15.00 * sets;
break;
case 2:
total_3 = 12.00 * sets;
break;
case 3:
total_3 = 18.00 * sets;
break;
case 4:
total_3 = 18.00 * sets;
break;
case 5:
total_3 = 15.00 * sets;
}
sum_3 += total_3;
}
void dessert_order(){
float total_4;
total_4 = 0;
sum_4 = 0;
dessert();
printf("Enter your choice : D");
scanf("%d", &choice);
printf("\nHow many sets do you want ?:");
scanf("%d", &sets);
switch (choice){
case 1:
total_4 = 15.00 * sets;
break;
case 2:
total_4 = 12.00 * sets;
break;
case 3:
total_4 = 18.00 * sets;
break;
case 4:
total_4 = 18.00 * sets;
break;
case 5:
total_4 = 15.00 * sets;
}
sum_4 += total_4;
}
void payment(){
float sum;
sum = 0;