0% found this document useful (0 votes)
2 views

PROJECT OF ICT LAB isfhan

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

PROJECT OF ICT LAB isfhan

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Department of Computer Science

ICT (LAB PROJECT)

PROJECT NAME = FOOD ORDERING SYSTEM

STUDENT NAME = Ali Muhammad khoso (70243)

Isfhan Yar (70260)

Sarib Laghari (69172)

SUBMITTED TO = Ma’am Hina Rizwan Khan

INTRODUCTION

The Food Ordering System, implemented in the C programming


language, is a basic console-based program enabling users to make
orders from a pre-existing menu. It computes the total cost considering
the items and quantities ordered.
PROJECT STATEMENT

Managing food orders in small-scale restaurants or food stalls in a


simple and efficient manner is highly important. The use of traditional
pen-and-paper methods can result in inaccuracies, inefficiencies, and
delays in processing orders. This project is focused on creating a
rudimentary food ordering system in C language that enables users to
make orders from a preset menu, calculates the total amount due, and
delivers a summary of the orders placed. The system must be easy to
use, reduce errors, and streamline the ordering process.

PROJECT CONTENT

FUNCTIONS

Initialization:

Variables choice, quantity, and total are declared and initialized.

choice and quantity are integers to store the user's input.

total is a float to store the cumulative total cost.


Display Menu:

The display Menu () function is called to print the menu to the screen.

User Input:

The program prompts the user to enter their choice.

The user’s input is read and stored in the choice variable.

Check for Exit:

The program checks if the user's choice is 5 (Exit).

If true, the loop breaks and the program proceeds to display the final
total.

Quantity Input:

If the choice is not 5, the program prompts the user to enter the
quantity.

The user’s input is read and stored in the quantity variable.

Switch Case for Choices:

The program uses a switch statement to handle different choices:

Case 1: Adds the cost of the Burger to the total.

Case 2: Adds the cost of the Pizza to the total.

Case 3: Adds the cost of the Pasta to the total.

Case 4: Adds the cost of the Sandwich to the total.


Default: Prints an error message for an invalid choice and continues the
loop.

Update Total:

The total cost is updated based on the user’s choice and quantity.

Display Current Total:

The current total is printed to the screen.

Repeat Loop:

The loop repeats from step 2 until the user chooses to exit.

Final Output:

When the user chooses to exit, the final total is printed.

A thank you message is displayed.

End:

The program ends and returns 0.

The following code offers a straightforward but efficient method


to handle food orders by utilizing switch case statements. It has the
potential to expand by enhancing the handling of invalid inputs,
preserving order information, and incorporating additional menu.

FLOW CHART OF FUNCTIONS


CODING
#include<stdio.h>
int total,price,quota,bill,tbill; char order,loop;
int main ()
{
do
{
printf("===================================");
printf("\nFOOD ORDERING SYSTEM SYSTEM : ");
printf("\n===================================");
printf("\n\t FOOD MENU : ");
printf("\n===================================");
printf("\n\nDishes:");
printf("\n(A) Chicken Karahi Rs 800");
printf("\n(B) Chapli Kabab Rs 500");
printf("\n(C) Seekh Kabab Rs 600");
printf("\n(D) Nihari Rs 900");
printf("\n(E) Mutton Karahi Rs 11000");
printf("\n\nRices:");
printf("\n(F) Chicken Plao Rs 50");
printf("\n(G) Chineese Rice Rs 16");
printf("\n(H) Mutton Biryani Rs 15");
printf("\n(I) Zarda Rs 38");
printf("\n(J) Brown Rice Rs 95");
printf("\n\nDesserts:");
printf("\n(K) Ice Cream Rs 80");
printf("\n(L) Falooda Rs 55");
printf("\n(M) Kheer Rs 40");
printf("\n(N) Halwa Rs 45");
printf("\n(O) Laddu Rs 50");
printf("\n\nDrinks:");
printf("\n(P) Mineral Water Rs 60");
printf("\n(Q) Cold Drink Rs 25");
printf("\n(R) Lassi Rs 28");
printf("\n(S) Tea Rs 26");
printf("\n(T) Coffee Rs 90");
printf("\n\nSalad:");
printf("\n(U) Green Salad Rs 110");
printf("\n(V) Fruit Salad Rs 80");
printf("\n(W) Russian Salad Rs 155");
printf("\n(X) Traditional Salad Rs 300");
printf("\n(Y) Chef Salad Rs 100");
printf("\n(Z) Hawain Salad Rs 200");
printf("\n\n___________________________________");

printf("\n\nPlace Your Order?");


printf("\n");
scanf("%s",&order);

switch(order)
{
case 'a': case 'A':
printf("You Ordered Chicken Karahi.");
price=600;
break;
case 'b': case 'B':
printf("You Ordered Chapli Kabab.");
price=700;
break;
case 'c': case 'C':
printf("You Ordered Seekh Kabab.");
price=800;
break;
case 'd': case 'D':
printf("You Ordered Nihari.");
price=900;
break;
case 'e': case 'E':
printf("You Ordered Mutton Karahi.");
price=1000;
break;
case 'f': case 'F':
printf("You Ordered Chicken Plao.");
price=10;
break;
case 'g': case 'G':
printf("You Ordered Chineese Rice.");
price=12;
break;
case 'h': case 'H':
printf("You Ordered Mutton Biryani.");
price=15;
break;
case 'i': case 'I':
printf("You Ordered Zarda.");
price=18;
break;
case 'j': case 'J':
printf("You Ordered Brown Rice.");
price=25;
break;
case 'k': case 'K':
printf("You Ordered Ice Cream.");
price=30;
break;
case 'l': case 'L':
printf("You Ordered Falooda.");
price=35;
break;
case 'm': case 'M':
printf("You Ordered Kheer.");
price=40;
break;
case 'n': case 'N':
printf("You Ordered Halwa.");
price=45;
break;
case 'o': case 'O':
printf("You Ordered Laddu.");
price=50;
break;
case 'p': case 'P':
printf("You Ordered Mineral Water.");
price=10;
break;
case 'q': case 'Q':
printf("You Ordered Cold Drink.");
price=25;
break;
case 'r': case 'R':
printf("You Ordered Lassi.");
price=28;
break;
case 's': case 'S':
printf("You Ordered Tea.");
price=26;
break;
case 't': case 'T':
printf("You Ordered Coffee.");
price=90;
break;
case 'u': case 'U':
printf("You Ordered Green Salad.");
price=110;
break;
case 'v': case 'V':
printf("You Ordered Fruit Salad.");
price=80;
break;
case 'w': case 'W':
printf("You Ordered Russian Salad.");
price=155;
break;
case 'x': case 'X':
printf("You Ordered Traditional Salad.");
price=300;
break;
case 'y': case 'Y':
printf("You Ordered Chef Salad.");
price=100;
break;
case 'z': case 'Z':
printf("You Ordered Hawain Salad.");
price=200;
break;
default:
printf("Invalid Entry, Please Restart.");
break;
}
printf("\n\nHow Many Order/s?");
printf("\n");
scanf("%d",&quota); bill=price*quota;
printf("\nYour Total bill is Rs %d.",bill);
printf("\n\nWant To Order Again? \nyes/no :");
printf("\n");
scanf("%s",&loop);
}
while(loop=='Y'||loop=='y');
if (loop=='N' ||loop=='n')
{ total=bill*0.06;
tbill=total+bill;
printf("\nYour Bill is Rs %d.");
printf("\n\n+Service Charges of bill is Rs %d.",total);
printf("\n\n___________________________________");
printf("\n\nYour Total Bill is Rs %d.",tbill);
printf("\n___________________________________");
printf("\n\n \tTHANK YOU FOR YOUR ORDER ");
}
else
{
printf("\nInvalid Choice, Please Restart.");
}
printf("\n\n===================================");
return 0;
}

OUTPUT RESULT
CONCLUSION

The Food Ordering System offers a fundamental framework for


managing food orders within a console-based application. It can be
expanded to incorporate additional functionalities, including improving
the robustness of handling invalid inputs, saving order details, and
introducing more menu items. The flowchart and function descriptions
provided give a comprehensive insight into the program's logic and
sequence.

You might also like