Question

In: Computer Science

Make a menu for a restaurant using python. Make sure there are choices on the menu....

Make a menu for a restaurant using python. Make sure there are choices on the menu. Give me a little description of how you did it.

Solutions

Expert Solution

Programmed with PyCharm.

Code:

from tkinter import *

window=Tk()
window.title("Restaurant Menu and Billing") # Title of the window
window.geometry("450x500") # Geometry of the Window

# Function to Calculate the total amount
def calculate():
    grilledShrimp = e1.get() # Get the quantity of Grilled Shrimp
    chickenWings = e2.get() # Get the quantity of Chicken Wings
    greekSalad = e3.get() # Get the quantity of Greek Salad
    caesarSalad = e4.get() # Get the quantity of Caesar Salad
    angusHamburger = e5.get() # Get the quantity of Angus Hamburger
    meatballSandwich = e6.get() # Get the quantity of Meatball Sandwich
    redmoorLinguine = e7.get() # Get the quantity of Redmoor Linguine
    linguineandMeatballs = e8.get() # Get the quantity of Linguine and Meatballs
    total=((int(grilledShrimp)*10) + (int(chickenWings)*11) + (int(greekSalad)*6) + (int(caesarSalad)*8) +
           (int(angusHamburger)*9) + (int(meatballSandwich)*9) + (int(redmoorLinguine)*10) + (int(linguineandMeatballs)*14)) # Calculate total amount
    label10 = Label(window, text =f"${total}", font="times 18").place(x=330, y =380) # Print total amount

# Labels that show the Items and their price
label0 = Label(window, text ="Menu", font="times 28 bold").place(x=150, y =30)
label9 = Label(window, text ="Item                     Price Qty", font="times 20 bold").place(x=90, y =80)
label1 = Label(window, text ="Grilled Shrimp                     $10", font="times 18").place(x=50, y =120)
label2 = Label(window, text ="Chicken Wings                    $11", font="times 18").place(x=50, y =150)
label3 = Label(window, text ="Greek Salad                         $6", font="times 18").place(x=50, y =180)
label4 = Label(window, text ="Caesar Salad                        $8", font="times 18").place(x=50, y =210)
label5 = Label(window, text ="Angus Hamburger                $9", font="times 18").place(x=50, y =240)
label6 = Label(window, text ="Meatball Sandwich              $9", font="times 18").place(x=50, y =270)
label7 = Label(window, text ="Redmoor Linguine              $10", font="times 18").place(x=50, y =300)
label8 = Label(window, text ="Linguine and Meatballs      $14", font="times 18").place(x=50, y =330)
label10 = Label(window, text ="Total: ", font="times 18").place(x=250, y =380)

# Entries that take in quantity as input
e1 = Entry(window, width=3)
e1.place(x=370, y=125)
e1.insert(0, "0") # Set zero as default value
e2 = Entry(window, width=3)
e2.place(x=370, y=155)
e2.insert(0, "0") # Set zero as default value
e3 = Entry(window, width=3)
e3.place(x=370, y=185)
e3.insert(0, "0") # Set zero as default value
e4 = Entry(window, width=3)
e4.place(x=370, y=215)
e4.insert(0, "0") # Set zero as default value
e5 = Entry(window, width=3)
e5.place(x=370, y=245)
e5.insert(0, "0") # Set zero as default value
e6 = Entry(window, width=3)
e6.place(x=370, y=275)
e6.insert(0, "0") # Set zero as default value
e7 = Entry(window, width=3)
e7.place(x=370, y=305)
e7.insert(0, "0") # Set zero as default value
e8 = Entry(window, width=3)
e8.place(x=370, y=335)
e8.insert(0, "0") # Set zero as default value

b1 = Button(window, text='Total', width=30, command=calculate).place(x=100, y=450) # Button when clicked displays the total amount

window.mainloop()

Output:


Related Solutions

The following is the menu options and serving sizes selected. Review the patient’s choices and using...
The following is the menu options and serving sizes selected. Review the patient’s choices and using the attached resource, estimate how many grams of carbohydrates are in each meal. Enter totals in the totals line. (Hint: pay close attention to serving sizes). Breakfast Lunch Dinner 2 slices white toast 2 eggs 3 bacon 8 oz glass of milk ¾ cup cheerios Whole large banana 6 oz sugar free yogurt Grilled ham and cheese sandwich 1 cup tomato soup 12 crackers...
in python Using this baseline template, write a program to input a choice from a menu...
in python Using this baseline template, write a program to input a choice from a menu def calcArea(length, width):    pass    def CalcVolumeSa(length, width, height):    pass def menu():    pass        def getValuesArea(): pass    def getValuesVolSa(): pass       def main():    menu() if __name__ == "__main__":    main() [1] - Calculate Area of rectangle [2] - calculate Volume and Surface area of Rectangle [x} - Exit Please select Option: input the appropriate values and calculate...
"Python lists are power data structures. Describe some of the benefits of Python lists" Make sure...
"Python lists are power data structures. Describe some of the benefits of Python lists" Make sure you don't just give me a list but a few sentences instead just answering it.
In Python write a program that prompts the user for a file name, make sure the...
In Python write a program that prompts the user for a file name, make sure the file exists and if it does reads through the file, count the number of times each word appears and then output the word count in a sorted order from high to low. The program should: Display a message stating its goal Prompt the user to enter a file name Check that the file can be opened and if not ask the user to try...
Write a program names EncryptDecrypt.java that has the following menu choices: Print menu and allow user...
Write a program names EncryptDecrypt.java that has the following menu choices: Print menu and allow user to choose options. The program must have a file dialogue box for text file. Output should be based on user choices. Read in a file Print the file to the console Encrypt the file and write it to the console Write out the encrypted file to a text file Clear the data in memory Read in an encrypted file Decrypt the file Write out...
Question 4 The owner of Line Restaurant implemented an expanded menu early last year. The menu...
Question 4 The owner of Line Restaurant implemented an expanded menu early last year. The menu was a success, drawing many more customers, who seemed to like the increased variety of menu choices over that of the previous menu. But good news soon became bad news as long waiting lines began to deter customers, layout does not meet the new demand requirements, and business dropped off. Because of space and other limitations, there didn’t seem to be any viable options...
convert this code to Python and make sure you use chained map and filter as well....
convert this code to Python and make sure you use chained map and filter as well. https://book.pythontips.com/en/latest/map_filter.html CODE BELOW IS IN JAVASCRIPT let people = [ {name: "Amy", pounds_weight: 152, inches_height: 63}, {name: "Joe", pounds_weight: 120, inches_height: 64}, {name: "Tom", pounds_weight: 210, inches_height: 78}, {name: "Jim", pounds_weight: 180, inches_height: 68}, {name: "Jen", pounds_weight: 120, inches_height: 62}, {name: "Ann", pounds_weight: 252, inches_height: 63}, {name: "Ben", pounds_weight: 240, inches_height: 72}, ]; //functions to convert pounds to kg and inches to meters let...
///create a main menu to enter choices such as "Welcome to any college" then please enter...
///create a main menu to enter choices such as "Welcome to any college" then please enter your choice of information when you press a key 1. view students. 2. insert student 3. remove student 4. exit...and student ID#, age, birthday, location, expected gradation date import java.util.Scanner; public class CourseCOM666 { private String courseName; private String [] students = new String[1]; private int numberOfStudents; public CourseCOM666(String courseName) { this.courseName = courseName; } public String[] getStudents(){ return students; } public int getNumberOfStudents(){...
Using the Below​ Data:                                                                                                              ​A: Prepare an Income Statement using the information given below. Make sure...
Using the Below​ Data:                                                                                                              ​A: Prepare an Income Statement using the information given below. Make sure to identify Gross​ Pofit, Operating​ Income, and Net Income. ​B: Calculate the​ P/E Ratio Inventories ​$ 50,000 Cost of Goods Sold ​$ 250,000 Administrative Expenses ​$ 50,000 Accumulated Depreciation ​$ 150,000 Sales ​$ 600,000 Depreciation Expense                 ​$ 25,000 Selling Expense ​$ 150,000 Common Stoock Dividends ​$ 8,000 Interest Expense ​$ 8,000 Corporate Tax Rate ​40% Cmmon Stock Shares ​100,000 Current Stock Market Price ​$...
THIS IS EXAM REVIEW, so please make sure to show the work and make sure the...
THIS IS EXAM REVIEW, so please make sure to show the work and make sure the work is correct. In all tests of hypothesis use the 5% level of significance unless told otherwise. In all confidence interval problems use 95% confidence unless told otherwise. SHOW YOUR WORK. 2. Test scores for a mathematics course have a normal distribution with a mean of 76 and a standard deviation of 12. a.What proportion of scores will be between 70 and 90? b....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT