I don't know how to code the receipt part of this program. Please help me. I'm a beginner.
Code:
#include <stdio.h>
#include <stdlib.h>
void MenuDisplay(void);
void Order(void);
void receipt(void);
void MenuDisplay(void){
printf("\t\t\t\t Restaurant Name");
printf("\n\n\t\t\t\t MENU");
printf("\n\t[1] Grilled Cheese\t80php\t [11] Squash Soup\t60php");
printf("\n\t[2] Apple Cider Chicken\t120php\t [12] Vegetarian Chili\t100php");
printf("\n\t[3] Steamed Green Beans\t95php\t [13] Ratatouille Salad\t110php");
printf("\n\t[4] BBQ Pulled Pork\t130php\t [14] Bacon Frittata\t100php");
printf("\n\t[5] Shrimp Pasta\t125php\t [15] Spicy Chicken\t130php");
printf("\n\t[6] Bacon Swiss Burger\t110php\t [16] Rosemary Chicken\t140php");
printf("\n\t[7] Chicken Parmesan\t120php\t [17] Smoked Salmon\t140php");
printf("\n\t[8] Beef Lasagna\t90php\t [18] Tortilla Wrap\t80php");
printf("\n\t[9] Mixed Green Salad\t85php\t [19] Braised Beef\t120php");
printf("\n\t[10] Salmon Teriyaki\t150php\t [20] Beef Pot Roast\t160php\n\n");
}
void Order(void){
int order, qty, total=0, more, charge=0;
do{
printf("\n\n\t\t\t TAKE ORDER");
printf("\n Enter [code number] Order: ");
scanf("%d",&order);
printf("\n Quantity: ");
scanf("%d",&qty);
if (order==1){
charge = 80*qty;
total +=charge;
}
if (order==2){
charge = 120*qty;
total +=charge;
}
if (order==3){
charge = 95*qty;
total +=charge;
}
if (order==4){
charge = 130*qty;
total +=charge;
}
if (order==5){
charge = 125*qty;
total +=charge;
}
if (order==6){
charge = 110*qty;
total +=charge;
}
if (order==7){
charge = 120*qty;
total +=charge;
}
if (order==8){
charge = 90*qty;
total +=charge;
}
if (order==9){
charge = 85*qty;
total +=charge;
}
if (order==10){
charge = 150*qty;
total +=charge;
}
if (order==11){
charge = 60*qty;
total +=charge;
}
if (order==12){
charge = 100*qty;
total +=charge;
}
if (order==13){
charge = 110*qty;
total +=charge;
}
if (order==14){
charge = 100*qty;
total +=charge;
}
if (order==15){
charge = 130*qty;
total +=charge;
}
if (order==16){
charge = 140*qty;
total +=charge;
}
if (order==17){
charge = 140*qty;
total +=charge;
}
if (order==18){
charge = 80*qty;
total +=charge;
}
if (order==19){
charge = 120*qty;
total +=charge;
}
if (order==20) {
charge = 160*qty;
total +=charge;
}
charge=0;
printf("\n Another Order? (1 for yes; 2 for no)");
scanf("%d",&more);
}
while(more!=2);
printf("\n%d",qty);
printf("\n%d",charge);
printf("\n%d",total);
}
void receipt(void){
int totord,i, qty, charge, total;
printf("Order\tQuantity\tPrice\n");
printf("Order\t%d\t%d\t\t%d\n",qty, charge, total);
for(i=0;i<totord;i++){
}
}
main(){
int select,choice;
MenuDisplay();
printf("OPTIONS");
printf("\n 01 Back to Menu");
printf("\n 02 Take Order");
printf("\n 03 Exit");
printf("\n\nSelect: ");
scanf("%d",&select);
if(select==1)
{
main();
}
else if(select==2)
{
Order();
}
else if(select==3){
printf("Thank you for visiting");
}
printf("\n1 Receipt\n");
printf("2 Options\n");
printf("3 Exit\n");
scanf("%d", &choice);
switch(choice)
{
case 1:
receipt();
break;
case 2:
//print
case 3:
//exit
default:
printf("Wrong Input");
}
system("pause");
}