Project C Final
Project C Final
PATIL POLYTECHNIC,KOLHAPUR
1. Introduction
C is a procedural programming language initially developed by Dennis Ritchie in the year 1972 at
Bell Laboratories of AT&T Labs. It was mainly developed as a system programming language to
write the UNIX operating system Each language has its own syntax and specific ways of doing
things, but the concepts covered here are common and applied to all programming languages.
Having an understanding of how things work and these universal concepts can take you a long
way in your coding journey. It makes learning a new technology easier in the long run.
The above program is an extended version of the previous program which demonstrates the use of
the goto statement along with a switch statement. The program is a simple menu card program that
allows the user to select a Menu from a list of options and then enter the quantity they would like
to order. The program then calculates the total cost of the order by multiplying the quantity by the
rate of the selected Menu. The switch statement is used to match the user's selection with the
corresponding Menu and its rate. The default case is used to handle any input that does not match
any of the options in the menu. The program then prints out the total amount for the order.
The history of the C programming language is closely tied to the history of the development of the
Unix Operating System.If we look back to understand what led to the development of the operating
system that changed the world of computing, we'll see the steps that led to the development of
C.Simply put, C was derived from the need to initially find and eventually create a language to
apply on the Unix Operating system.
1
DR. D.Y.PATIL POLYTECHNIC,KOLHAPUR
2.Course Outcome
❖ The theory practical experience and relevant softskills associated with this course are to be
2
DR. D.Y.PATIL POLYTECHNIC,KOLHAPUR
3.Literature Review
1) https://www.geeksforgeeks.org/c-programming-language/
We visted to this website to know the basic information about C programming language. This
gives us the History of C programming language
2) https://www.programiz.com/c-programming/c-switch-case-statement
We visited to this website for to know the use of switch case statement.
3) https://www.tutorjoes.in/c.programming.tutorial/hotel.goto.in.c
We visited to this website for to demonstrates the use of the goto statement along with a switch
statement.
3
DR. D.Y.PATIL POLYTECHNIC,KOLHAPUR
1) Working :
The program is a simple menu card program that allows the user to select a drink from a list of
options and then enter the quantity they would like to order. The program then calculates the total
cost of the order by multiplying the quantity by the rate of the selected The switch statement is
used to match the user's selection with the corresponding drink and its rate. The default case is
used to handle any input that does not match any of the options in the menu. The program then
prints out the total amount for the order.
4
DR. D.Y.PATIL POLYTECHNIC,KOLHAPUR
2) Algorithm :
Step 1: Start
Step 2: Declare Variable ch, qty,I,net;
Step 3: Assign the value to variable
Step 4: Switch (ch)
Case 1: print .Paneer Tikka
Input qty*230
Net=net+qty
Break;
Case 2: print Paneer masala
Input qty*220
Net=net+qty
Break;
Case 3: print Veg Pulav
Input qty*200
Net=net+qty
Break;
Case 4: print Special Veg
Input qty*250
Net=net+qty
Break;
Case 5: print Kaju Kurma
Input qty*280
Net=net+qty
Break;
Case 6: print Masur tadka
Input qty*180
5
DR. D.Y.PATIL POLYTECHNIC,KOLHAPUR
Net=net+qty
Break;
Case 7: print Akkha Masur
Input qty*200
Net=net+qty
Break;
Default:
Print invalid Product Selection
Break;
Step 5: print Do you want to continue press 1
( If i = = 1)
6
DR. D.Y.PATIL POLYTECHNIC,KOLHAPUR
5 .Flowchart
Start
Joes;
Case 1
Case 2
You selected
Case 3
You selected
hhddsjsddjskds
er
Case 4
7
DR. D.Y.PATIL POLYTECHNIC,KOLHAPUR
Case 5
You selected
Case 6
You selected
Case 7
You selected
9999999
Default
Invalid input
To
continue
If i==1
Print total
8
Stop
DR. D.Y.PATIL POLYTECHNIC,KOLHAPUR
4) Coding :
#include<stdio.h>
#include<conio.h>
void main()
{
int ch,qty,i,net=0;
clrscr();
printf("\n\t\t\tHotel Anirudh\n\n\n");
joes:
printf("\n\t\t\tMENU CARD\n");
printf("\n\t\t1.Paneer Tikka Rs:230");
printf("\n\t\t2.Paneer Masala Rs:220");
printf("\n\t\t3.Veg Pulav Rs:200");
printf("\n\t\t4.Special veg Rs:250");
printf("\n\t\t5.Kaju Kurma Rs:280");
printf("\n\t\t6.Masur tadka Rs:180");
printf("\n\t\t7.Akkha masur Rs:200");
printf("\n\n Enter Your choice : ");
scanf("%d",&ch);
switch(ch)
{
case 1:
printf("\nYou have selected Paneer Tikka");
printf("\nEnter The Qty : ");
9
DR. D.Y.PATIL POLYTECHNIC,KOLHAPUR
scanf("%d",&qty);
net=net+(qty*230);
break;
case 2:
printf("\nYou have selected Paneer Masala ");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*220);
break;
case 3:
printf("\nYou have selected Veg Pulav ");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*200);
break;
case 4:
printf("\nYou have selected Special veg ");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*250);
break;
case 5:
printf("\nYou have selected Kaju Kurma ");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*280);
break;
case 6:
printf("\nYou have selected Masur tadka ");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
10
DR. D.Y.PATIL POLYTECHNIC,KOLHAPUR
net=net+(qty*180);
break;
case 7:
printf("\nYou have selected Akkha masur ");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*200);
break;
default:
printf("\nInvalid Product Selection");
break;
}
printf("\nDo You want to continue press 1: ");
scanf("%d",&i);
if(i==1)
{
goto joes ;
}
printf("\nTotal amount : %d",net);
printf("\nThank You Come Again");
getch();
}
11
DR. D.Y.PATIL POLYTECHNIC,KOLHAPUR
6. Output
12
DR. D.Y.PATIL POLYTECHNIC,KOLHAPUR
Conclusion
In this C program we conclude that how to make the the food ordering and billing
system using C language. Using switch case we have created the food ordering system to
make food ordering and billing easy. It is a very fast and smart way to order food. It is
user friendly. It takes less time to order and billing of food.
13