A) Write a program to automate the billing system for a restaurant. The program should do the following:
Show the customer the different items offered by the restaurant.
Allow the customer to select two items from the menu.
Calculate and print the bill.
Assume that the restaurant offers the following sandwich and drink items (5 items) (the price of each item is shown to the right of the item):
Falafel 0.80 JD
Kabab 2.80 JD
Shawarma 1.80 JD
Pepsi 0.50 JD
Juice 0.99 JD
Your program must contain at least the following functions:
Function showMenu that shows the different items offered by the restaurant and tells the user to select only two items from the menu.
Function printCheck: This function calculates and prints the bill. (Note that the billing amount should include a 10% tax.)
A sample output is:
Receopt.png
B) Update the previous program so that allows the customer to select multiple items and specify the count?
I know that the program is wrong
I think that you understood me wrongly or that I did not explain to you but I want to learn, I do not want to write the program for me
Your loop for taking in input doesn't make sense. You want to take in two menu items, just you take in two menu items twice - which means you take in 4 menu items.
void main should be int main.
Is there a reason for the class? It doesn't seem necessary.
Looks like it does everything up to calculating the bill. For that you'll wanna either hard code it like this:
But you don't need the struct, you could just have a bunch of doubles, or an array of doubles like zapshe shows, since you aren't actually using the menu object for anything. Alternatively, you could pass the menu as a parameter into printCheck.
For tax, you'd add to the total price by 10%, or multiply by 1.1.