-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path179.py
More file actions
90 lines (48 loc) · 2.16 KB
/
179.py
File metadata and controls
90 lines (48 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
from tkinter import *
from PIL import ImageTk, Image
from tkinter import ttk
root= Tk()
root.title("Juice Shop")
root.geometry("800x600")
root.config(bg="orange2")
label_heading= Label(root,text="Juice Shop",bg="orange2" ,font=("Bahnschrift Light" ,18 ,"bold"))
label_heading.place(relx=0.05,rely=0.1,anchor=W)
Juice= ImageTk.PhotoImage(Image.open ("logo.png"))
Juice_label= Label(root, image=Juice,bg="orange2")
Juice_label.place(relx=0.2,rely=0.4,anchor= CENTER)
Mango_img=ImageTk.PhotoImage(Image.open ("mango_img.png"))
Apple_img=ImageTk.PhotoImage(Image.open ("apple_img.png"))
Orange_img=ImageTk.PhotoImage(Image.open ("orange.png"))
fruit_img_label= Label(root ,bg="orange2")
fruit_img_label.place(relx=0.75,rely=0.8,anchor=CENTER)
fruit_label= Label(root,text="Select Fruit")
fruit_label.place(relx=0.96,rely=0.2,anchor= E)
fruit_list= ["Orange","Mango","Apple"]
fruit_dropdown= ttk.Combobox(root, state="readonly", values=fruit_list)
fruit_dropdown.place(relx=0.95,rely=0.25,anchor=E)
Quantity_label= Label(root,text="Enter Quantity")
Quantity_label.place(relx=0.96,rely=0.35,anchor= E)
Quantity_input= Entry(root)
Quantity_input.place(relx=0.95,rely=0.4,anchor=E)
Amount_label= Label(root)
Amount_label.place(relx=0.95,rely=0.7,anchor=E)
calerie_label= Label(root)
calerie_label.place(relx=0.95,rely=0.8,anchor=E)
class JUICE:
def __init__(self,fruit_name,quantity):
self.fruit= fruit_name
self.quantity= int(quantity)
self.__cost= 75
def __calculatecost(self):
total_amount= self.__cost*self.quantity
Amount_label['text']=("Your Total Cost Is :- "+ str(total_amount))
if self.fruit == "Apple":
calories= self.quantity *52
elif self.fruit == "Orange":
calories= self.quantity *47
elif self.fruit == "Mango":
calories= self.quantity *60
print("calories count for " + self.fruit +" of quantity " + str(self.quantity) + " is " + str(calories))
def getamount(self):
self.__calculatecost()
root.mainloop()