#include <stdio.h>
#include <stdlib.h>
#include <math.h>
void brst();
void thight();
void wings();
void back();
void neck();
void menu();
void ex();
float price;
float total;
char choice;
int again;
void main()
{
menu();
}
void menu()
{
char choice = ' ' ;
printf("----------------------------------------------------------------------");
printf("\n Welcome to Chicken Chicky Place. \n ");
printf(" && Please select the chicken part that you
would like to purchase. && \n\n");
printf(" [A] Breast\n");
printf(" [B] Thigh\n");
printf(" [C] Wings\n");
printf(" [D] Back\n");
printf(" [E] Neck\n");
printf("\n");
printf(" [F] Exit\n\n");
printf("Enter your choice here : ");
scanf("%c", &choice);
printf("----------------------------------------------------------------------");
{
if ((choice) == 'A' )
brst();
else
if ((choice) == 'B')
thight();
else
if ((choice) == 'C')
wings();
else
if ((choice) == 'D')
back();
else
if ((choice) == 'E')
neck();
else
if ((choice) == 'F')
ex();
else
if ((choice) != 'A' , 'B' , 'C' , 'D' ,'E', 'F')
{
printf("\n");
system("clear");
menu();
}
}
}
void brst()
{
int choice = 0;
int quantity = 0;
int again = 0;
printf("\n Welcome to Chicken Chicky Place. \n ");
printf(" $ Cooking Style $ \n\n");
printf(" && Please select the cooking that you would
like && \n\n");
printf(" [1] ASAM PEDAS - RM 2.50\n");
printf(" [2] SAMBAL - RM 3.00\n");
printf(" [3] ROASTED - RM 5.00\n");
printf(" [4] GRILLED - RM 6.00\n");
printf("Enter your choice here : ");
scanf("%d", &choice);
{
if (choice == 1)
{
printf("Enter quantity (pieces) : ");
scanf("%d", &quantity);
total = 2.50 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the
counter\n\n\n ", total);
printf("\nWould you like to buy anything else?\n[1] Yes , [2]
No : ");
scanf("%d", &again);
system("clear");
if (again == 1 )
brst();
else
if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\n\t\tSorry Invalid Decision
Entered\n\n\n\n");
ex();
}
}
else
if ( choice == 2)
{
printf("Enter quantity (pieces) : ");
scanf("%d", &quantity);
total = 3.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the
counter\n\n\n ",total);
printf("\nWould you like to buy anything else?\n[1] Yes , [2]
No : ");
//Allows user to choose whether to check-out or buy anything
else.
scanf("%d", &again);
system("clear");
if (again == 1 )
brst();
else if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\n\t\tSorry Invalid Decision
Entered\n\n\n\n");
ex();
}
}
else
if ( choice == 3 )
{
printf("Enter quantity (pieces): ");
scanf("%d", &quantity);
total = 5.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the
counter\n\n\n ", total);
printf("\nWould you like to buy anything else?\n[1] Yes , [2]
No : ");
scanf("%d", &again);
system("clear");
if (again == 1 )
brst();
else if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\nSorry Invalid Decision Entered\n\n\n\n");
ex();
}
}
else
if ( choice == 4 )
{
printf("Enter quantity (pieces) : ");
scanf("%d", &quantity);
total = 6.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the
counter\n\n\n ",total);
printf("\nWould you like to buy anything else?\n[1] Yes , [2]
No : ");
// Allows user to choose whether to check-out or buy anything
else.
scanf("%d", &again);
system("clear");
if (again == 1 )
{
brst();
}
else
if (again == 2 )
{
menu();
}
else
if (again != 1 , 2)
{
printf("\n\n\t\tSorry Invalid Decision
Entered\n\n\n\n");
ex();
}
}
else
if (choice != 1 , 2 , 3 )
{
printf("\n\n\t\t Invalid Choice Entered\n\n");
ex();
}
}
}
void thight()
{
int choice;
int quantity;
int again;
printf(" Welcome to Chicken Chicky Place. \n ");
printf(" $ Cooking style $ \n\n");
printf(" && Please select the cooking style that you
would like to purchase. &&\n\n");
printf(" [1] ASAM PEDAS - RM 2.50\n");
printf(" [2] SAMBAL - RM 3.00\n");
printf(" [3] ROASTED - RM 5.00\n");
printf(" [4] GRILLED - RM 6.00\n");
printf("Enter your choice here : ");
scanf("%d", &choice);
{
if (choice == 1)
{
printf("Enter quantity (pieces) : ");
scanf("%d", &quantity);
total = 2.50* quantity ;
printf("Your total amount is RM%.2f , Please pay at the
counter\n\n\n ", total);
{
printf("\nWould you like to buy anything else?\n[1] Yes , [2]
No : ");
scanf("%d", &again);
system("clear");
if (again == 1 )
thight();
else
if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\nSorry Invalid Decision Entered\n\n\n\n");
ex();
}
}
}
else
if ( choice == 2)
{
printf("Enter quantity (pieces) : ");
scanf("%d", &quantity);
total = 3.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the
counter\n\n\n ",total);
{
printf("\nWould you like to buy anything else?\n[1] Yes , [2]
No : ");
scanf("%d", &again);
system("clear");
if (again == 1 )
thight();
else
if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\nSorry Invalid Decision Entered\n\n\n\n");
ex();
}
}
}
else
if ( choice == 3 )
{
printf("Enter quantity (pieces) : ");
scanf("%d", &quantity);
total = 5.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the
counter\n\n\n ",total);
{
printf("\nWould you like to buy anything else?\n[1] Yes , [2]
No :");
scanf("%d", &again);
system("clear");
if (again == 1 )
thight();
else
if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\n\t\tSorry Invalid Decision
Entered\n\n\n\n");
ex();
}
}
}
else
if ( choice == 4 )
{
printf("Enter quantity (pieces) : ");
scanf("%d", &quantity);
total = 6.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the
counter\n\n\n ",total);
{
printf("\nWould you like to buy anything else?\n[1] Yes , [2]
No :");
scanf("%d", &again);
system("clear");
if (again == 1 )
thight();
else
if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\n\t\tSorry Invalid Decision
Entered\n\n\n\n");
ex();
}
}
}
else
if (choice != 1 , 2 , 3)
{
printf("\n\n Invalid Choice Entered\n\n");
thight();
}
}
}
void wings()
{
int choice;
int quantity;
int again;
printf(" Welcome to Chicken Chicky Place. \n ");
printf(" $ Cooking style $ \n\n");
printf(" && Please select the cooking style that you
would like to purchase. &&\n\n");
printf(" [1] ASAM PEDAS - RM 2.50\n");
printf(" [2] SAMBAL - RM 3.00\n");
printf(" [3] ROASTED - RM 5.00\n");
printf(" [4] GRILLED - RM 6.00\n");
printf("Enter your choice here : ");
scanf("%d", &choice);
{
if (choice == 1)
{
printf("Enter quantity (pieces) : ");
scanf("%d", &quantity);
total = 2.50 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the
counter\n ", total);
{
printf("\nWould you like to buy anything else?\n[1] Yes , [2]
No : ");
scanf("%d", &again);
system("clear");
if (again == 1 )
wings();
else
if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\nSorry Invalid Decision Entered\n\n\n\n");
ex();
}
}
}
else
if ( choice == 2)
{
printf("Enter quantity (pieces) : ");
scanf("%d", &quantity);
total = 3.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the
counter\n ", total);
{
printf("\nWould you like to buy anything else?\n[1] Yes , [2]
No : ");
scanf("%d", &again);
system("clear");
if (again == 1 )
wings();
else
if (again == 2 )
menu();
else
if (again != 1 , 2 )
{
printf("\n\n\t\tSorry Invalid Decision
Entered\n\n\n\n");
ex();
}
}
}
else
if ( choice == 3 )
{
printf("Enter quantity (pieces) : ");
scanf("%d", &quantity);
total = 5.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the
counter\n\n\n ",total);
{
printf("\nWould you like to buy anything else?\n[1] Yes , [2]
No :");
scanf("%d", &again);
system("clear");
if (again == 1 )
wings();
else
if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\nSorry Invalid Decision Entered\n\n\n\n");
ex();
}
}
}
else
if ( choice == 4 )
{
printf("Enter quantity (pieces): ");
scanf("%d", &quantity);
total = 6.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the
counter\n\n\n ",total);
{
printf("\nWould you like to buy anything else?\n[1] Yes , [2]
No :");
scanf("%d", &again);
system("clear");
if (again == 1 )
wings();
else
if (again == 2 )
menu();
else
if (again != 1 , 2 )
{
printf("\n\n\t\tSorry Invalid Decision
Entered\n\n\n\n");
ex();
}
}
}
else
if (choice != 1 , 2 )
{
printf("\n\n Invalid Choice Entered\n\n");
wings();
}
}
}
void back()
{
int choice = 0;
int quantity = 0;
int again = 0;
printf("\n Welcome to Chicken Chicky Place. \n ");
printf(" $ Cooking Style $ \n\n");
printf(" && Please select the cooking that you would
like && \n\n");
printf(" [1] ASAM PEDAS - RM 2.50\n");
printf(" [2] SAMBAL - RM 3.00\n");
printf(" [3] ROASTED - RM 5.00\n");
printf(" [4] GRILLED - RM 6.00\n");
printf("Enter your choice here : ");
scanf("%d", &choice);
{
if (choice == 1)
{
printf("Enter quantity (pieces) : ");
scanf("%d", &quantity);
total = 2.50 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the
counter\n\n\n ", total);
printf("\nWould you like to buy anything else?\n[1] Yes , [2]
No : ");
scanf("%d", &again);
system("clear");
if (again == 1 )
back();
else
if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\n\t\tSorry Invalid Decision
Entered\n\n\n\n");
ex();
}
}
else
if ( choice == 2)
{
printf("Enter quantity (pieces) : ");
scanf("%d", &quantity);
total = 3.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the
counter\n\n\n ",total);
printf("\nWould you like to buy anything else?\n[1] Yes , [2]
No : ");
//Allows user to choose whether to check-out or buy anything
else.
scanf("%d", &again);
system("clear");
if (again == 1 )
back();
else if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\n\t\tSorry Invalid Decision
Entered\n\n\n\n");
ex();
}
}
else
if ( choice == 3 )
{
printf("Enter quantity (KG): ");
scanf("%d", &quantity);
total = 5.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the
counter\n\n\n ", total);
printf("\nWould you like to buy anything else?\n[1] Yes , [2]
No : ");
scanf("%d", &again);
system("clear");
if (again == 1 )
back();
else if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\nSorry Invalid Decision Entered\n\n\n\n");
ex();
}
}
else
if ( choice == 4 )
{
printf("Enter quantity (KG) : ");
scanf("%d", &quantity);
total = 6.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the
counter\n\n\n ",total);
printf("\nWould you like to buy anything else?\n[1] Yes , [2]
No : ");
// Allows user to choose whether to check-out or buy anything
else.
scanf("%d", &again);
system("clear");
if (again == 1 )
{
back();
}
else
if (again == 2 )
{
menu();
}
else
if (again != 1 , 2)
{
printf("\n\n\t\tSorry Invalid Decision
Entered\n\n\n\n");
ex();
}
}
else
if (choice != 1 , 2 , 3 )
printf("\n\n\t\t Invalid Choice Entered\n\n");
ex();
}
}
void neck()
{
int choice = 0;
int quantity = 0;
int again = 0;
printf("\n Welcome to Chicken Chicky Place. \n ");
printf(" $ Cooking Style $ \n\n");
printf(" && Please select the cooking that you would
like && \n\n");
printf(" [1] ASAM PEDAS - RM 2.50\n");
printf(" [2] SAMBAL - RM 3.00\n");
printf(" [3] ROASTED - RM 5.00\n");
printf(" [4] GRILLED - RM 6.00\n");
printf("Enter your choice here : ");
scanf("%d", &choice);
{
if (choice == 1)
{
printf("Enter quantity (KG) : ");
scanf("%d", &quantity);
total = 2.50 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the
counter\n\n\n ", total);
printf("\nWould you like to buy anything else?\n[1] Yes , [2]
No : ");
scanf("%d", &again);
system("clear");
if (again == 1 )
neck();
else
if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\n\t\tSorry Invalid Decision
Entered\n\n\n\n");
ex();
}
}
else
if ( choice == 2)
{
printf("Enter quantity (KG) : ");
scanf("%d", &quantity);
total = 3.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the
counter\n\n\n ",total);
printf("\nWould you like to buy anything else?\n[1] Yes , [2]
No : ");
//Allows user to choose whether to check-out or buy anything
else.
scanf("%d", &again);
system("clear");
if (again == 1 )
neck();
else if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\n\t\tSorry Invalid Decision
Entered\n\n\n\n");
ex();
}
}
else
if ( choice == 3 )
{
printf("Enter quantity (KG): ");
scanf("%d", &quantity);
total = 5.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the
counter\n\n\n ", total);
printf("\nWould you like to buy anything else?\n[1] Yes , [2]
No : ");
scanf("%d", &again);
system("clear");
if (again == 1 )
neck();
else if (again == 2 )
menu();
else
if (again != 1 , 2)
{
printf("\n\nSorry Invalid Decision Entered\n\n\n\n");
ex();
}
}
else
if ( choice == 4 )
{
printf("Enter quantity (KG) : ");
scanf("%d", &quantity);
total = 6.00 * quantity ;
printf("Your total amount is RM%.2f , Please pay at the
counter\n\n\n ",total);
printf("\nWould you like to buy anything else?\n[1] Yes , [2]
No : ");
// Allows user to choose whether to check-out or buy anything
else.
scanf("%d", &again);
system("clear");
if (again == 1 )
{
neck();
}
else
if (again == 2 )
{
menu();
}
else
if (again != 1 , 2)
{
printf("\n\n\t\tSorry Invalid Decision
Entered\n\n\n\n");
ex();
}
}
else
if (choice != 1 , 2 , 3 )
{
printf("\n\n\t\t Invalid Choice Entered\n\n");
ex();
}
}
}
void ex() // Exit Screen
{
printf("\n");
printf(" Thank You Very Much \n ");
printf(" && Please come again. &&
\n\n");
}