Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main(void) {
- int num;
- int OrderNumber = 0;
- int yn;
- int TotalPrice = 0;
- char* food[5][2] = { {"Spaghetti", 18000}, {"Takoyaki", 15000}, {"Teriyaki", 25000}, {"Ramen", 20000}, {"Soba", 25000} };
- int order[5][10];
- printf("Restaurant Menu Ver 1.0 \n");
- printf("Press 1 for Menu Option \n");
- printf("Press 2 for Pay Option \n");
- scanf_s("%d", &num);
- if (num == 1) {
- num = 0;
- system("cls");
- system("Color f");
- printf("Our Menu \n");
- printf("0 | %-9s | RP %i,- \n", food[0][0], food[0][1]);
- printf("1 | %-9s | RP %i,- \n", food[1][0], food[1][1]);
- printf("2 | %-9s | RP %i,- \n", food[2][0], food[2][1]);
- printf("3 | %-9s | RP %i,- \n", food[3][0], food[3][1]);
- printf("4 | %-9s | RP %i,- \n", food[4][0], food[4][1]);
- printf("What would you like to order? (Insert The Number) \n");
- scanf_s("%d", &num);
- printf("You chose %s \n", food[num][0]);
- TotalPrice = TotalPrice + food[num][1];
- printf("Price: %i \n", TotalPrice);
- printf("Would you like to order more? (0/1) \n");
- scanf_s("%i", &yn);
- if (yn == 1) {
- system("cls");
- system("Color f");
- printf("Our Menu \n");
- printf("0 | %-9s | RP %i,- \n", food[0][0], food[0][1]);
- printf("1 | %-9s | RP %i,- \n", food[1][0], food[1][1]);
- printf("2 | %-9s | RP %i,- \n", food[2][0], food[2][1]);
- printf("3 | %-9s | RP %i,- \n", food[3][0], food[3][1]);
- printf("4 | %-9s | RP %i,- \n", food[4][0], food[4][1]);
- printf("What would you like to order? (Insert The Number) \n");
- scanf_s("%d", &num);
- printf("You chose %s \n", food[num][0]);
- TotalPrice = TotalPrice + food[num][1];
- printf("Price: %i \n", TotalPrice);
- }
- }
- else if (num == 2) {
- printf("Payment \n");
- printf("Your order was");
- }
- system("pause > nul");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement