Python Challenge 8 (GUI)
Costa Fortune Coffee is developing a GUI for their stores. They think a graphical user interface might make the system more user friendly. The system needs to have buttons that users can select, it needs to display the order total when the finish button is clicked and the system should generate a bill in a word document that can be used as a receipt. The bill should display the order number, the items ordered and also the order cost.
They have a basic GUI that runs a function everytime a button is clicked. They have built a function for tea and coffee and one to run the order, update the screen and create a bill. However they need to develop it further to make it compatible with their menu (shown below)....
The basic code that the coffee shop has is shown below. Run it to check it works then see if you can develop it further to work with the coffee shop menu shown.
#function that runs when coffee is selected
#function that runs when tea is selected
#function that runs when finish order is selected
print("Order number: ", order_number)
print("Your order is: ", order)
print("Payment due: £", cost)
file=open('your_bill' + str(order_number) + '.doc','w')
file.write("Order = " + repr(order) + "\n")
file.write("Cost = £" + repr(cost) + "\n")
#code to set up your window
from tkinter import*
from tkinter import ttk
EXT: Other improvements could include.....
Adding a title to the GUI.
importing an image onto the GUI.
Changing the colour of the GUI.
Defining the GUI size.
Adding a running total cost of all orders so they know how much money they have made.
A record of products ordered so they know how many of each product they have sold.