-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBORILLO_LABACT3.py
More file actions
57 lines (54 loc) · 1.76 KB
/
BORILLO_LABACT3.py
File metadata and controls
57 lines (54 loc) · 1.76 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
name = input("Good day! What is your name? ")
print("Welcome " + name.upper() + "!")
userinp = input("Would you like to buy apples at a rate of 20.0? ")
userinp = userinp.upper()
if userinp == "YES":
apples = float(input("How many? "))
else:
apples = 0
print("")
userinp = input("Would you like to buy mangoes at a rate of 15.0? ")
userinp = userinp.upper()
if userinp == "YES":
mangoes = float(input("How many? "))
else:
mangoes = 0
print("")
userinp = input("Would you like to buy oranges at a rate of 10.0? ")
userinp = userinp.upper()
if userinp == "YES":
oranges = float(input("How many? "))
else:
oranges = 0
print("")
price = (apples*20) + (mangoes*15) + (oranges*10)
apprice = (apples*20)
manprice = (mangoes*15)
orprice = (oranges*10)
if price >= 200:
discount = (price*0.20)
final = price - discount
else:
discount = 0
final = price
print("")
print("Here is the list of the items you bought!"
"\n" + str(apples) + " pcs. of apples --------------- " + "Php " + str(apprice))
print(str(mangoes) + " pcs. of mangoes --------------- " + "Php " + str(manprice))
print(str(oranges) + " pcs. of oranges --------------- " + "Php " + str(orprice))
print("=====================================")
print("Total: " + str(price))
print("")
print("Hello " + name.upper())
print("Total Amount: ======================= " + str(final))
if discount <= 0:
print()
else:
print("Discount: ======================= " + str(discount))
pay = float(input("Cash Tendered: ======================= "))
change = pay - final
if change >= 0:
print("Change: ======================= " + str(change))
print("Thanks for buying!")
else:
print("That's not enough money. Please buy again.")