11. Cafeteria Management System Code - Part 2
Hello folks!
Welcome to the blog series.In the previous blog we have seen about the libraries that we used in our program as well as the declaration of class, methods and variables. So in this blog we will continue with the remaining part code which includes global variables as well as main() function.
So as you can see we have used the standard namespace for using standard input and output. Next is the flag which is a global variable which is used so that the first part of the program which gives the user output whether the program has started runs only once. Another variable is of type ofstream which is used for writing every bill printed into a log file.
Another global variable is a pointer which stores the address of objects of class Cafe. In the main function we have declared two variable cmd which stores the option number for the item which the customer has ordered and table_number which stores table number. As explained earlier the use of flag variable the user gets to know the program has started. Also we are opening the Cafe_log.txt file to write the new bills. Next we are taking the input for table number and corresponding option for the item that the customer has ordered.
According to the option that the user has entered the program asks for the quantity for that item that the customer wants to order or print the bill or exit from the program. If the user opts for the option for the bill we also simultaneously write the bill the log file and if the user wants to exit the program then we close the log file which was opened earlier.
If the user enters in inappropriate command then an message is displayed for the same. So this is all about the code.The link of the code is attached below. In the next blog we will discuss about theoretical background of the project which is based on socket programming.
Link of the code : Cafeteria Management System Code
By :
Ashutosh Bardapurkar (k-05)
Hrishikesh Deshpande (k-16)
Archit Hiwrekar (k-23)
Chinmay Kapkar (k-33)
Badiya hai ..
ReplyDeleteThank you for your feedback.
DeleteThanks man for the code
ReplyDeleteThank you for feedback
DeleteGood stuff!
ReplyDeleteThank you for feedback
DeleteInteresting
ReplyDelete