-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CheckoutApp.py
101 lines (50 loc) · 1.91 KB
/
CheckoutApp.py
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
91
92
93
94
95
96
97
from collections import Counter
counter = 0
number = 0
unit = 0
discount = 0
subTotal = 0
items = []
price = []
quantity = []
totals = []
while counter <= 0:
customerName = str(input("What is the customer's Name "))
itemname = str(input("What did the user buy "))
number = int(input("How many pieces? "))
unit = int(input("How much per unit? "))
counter += 1
total = int(number * unit)
items.append(itemname)
price.append(unit)
quantity.append(number)
totals.append(total)
itemset = str(input("Add more items? "))
proceed = "yes"
if itemset.lower() == "proceed":
cashierName = str(input("What is the Cashier's name? "))
discount = int(input("How much discount will he get: "))
print("SEMICOLON STORES")
print("MAIN BRANCH")
print("LOCATION: 312, HERBERT MACAULAY WAY, SABO YABA, LAGOS.")
print("TEL: 03293828343")
print(f"{customerName}")
print("============================================================")
print("ITEM QTY PRICE TOTAL(NGN)")
print("------------------------------------------------------------")
result = dict(Counter(totals))
for number, unit in result.items():
print(f"{quantity.count(number)}\t\t + {price.count(unit)}\t\t + {totals.count(total)}");
subTotal += totals.count(total)
costDiscount = discount * subTotal / 100;
vat = 17.50 / 100 * subTotal;
billTotal = subTotal + vat - costDiscount;
print("-----------------------------------------------------------")
print(f"\t\t\tSub Total: \t\t{subTotal}")
print(f"\t\t\tDiscount: \t\t{costDiscount}")
print(f"\t\t\tVAT at 17.50 : \t\t{vat}")
print("============================================================");
print(f"\t\t\tBill Total: \t{billTotal}");
print("============================================================");
print(f" THIS IS NOT A RECEIPT KINDLY PAY, {billTotal}");
print("============================================================");