@WiNDfaLLx/

mock prerelease condensed

Python

lmao

fork
loading
Files
  • main.py
main.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
from datetime import datetime
now = datetime.now()
estimatenumber = 0
ordersplaced = []
ordervaluetotal = 0
allcomponents = [["Processor", ["p3", 100, 10], ["p5", 120, 10], ["p7", 200, 10]], ["RAM", ["16 GB", 75, 10], ["32 GB", 150, 10]], ["Storage", ["1 TB", 50, 10], ["2 TB", 100, 10]], ["Screen", ["19\"", 65, 10], ["23\"", 120, 10]], ["Case", ["Mini Tower", 40, 10], ["Midi Tower", 70, 10]], ["USB Port", ["2 ports", 10, 10], ["4 ports", 20, 10]]]
while int(now.hour) < 18:
  customerchoice = ""
  customercomponents = []
  componenttotal = 0
  orderit = ""
  customerdetails = ["name", "phone number"]
  input("Press enter to start building your custom-built PC! \nThis program will give you an estimated price and allow you to place an order.")
  estimatenumber += 1
  for component in allcomponents:
    print("\n" + component[0], "options:")
    for choice in component[1:]:
      print(str(component.index(choice)) + ". ", choice[0], end="  ")
    while customerchoice not in ["1", "2", "3"]:
      customerchoice = input("\nPlease enter the number of the " + component[0] + " option you would like to choose (a single digit):")
    customerchoice = int(customerchoice)
    customercomponents.append(customerchoice)
    componenttotal += component[customerchoice][1]
  print("\nEstimate Number:", estimatenumber)
  print("Your custom-built PC will have these components-")
  for component in allcomponents:
    print(component[0] + ":", component[customercomponents[allcomponents.index(component)]][0], "at $" + str(component[customercomponents[allcomponents.index(component)]][1]))
  print("Build Cost: $" + str(componenttotal*0.2))
  print("\nIts estimated price is", str(componenttotal*1.2) +  "$")
  while orderit not in ["Y", "N"]:
    orderit = input("\nPlace this order? Please enter Y or N:")
    orderit = orderit.upper()
  if orderit == "Y":
    for component in allcomponents:
      if component[customercomponents[allcomponents.index(component)]][2] < 1:
        print("\nSorry, the", component[customercomponents[allcomponents.index(component)]][0], component[0].lower(), "is out of stock!")
        orderit = "N"
  else:
    print("\nYour order has been cancelled.\n\n")
  if orderit == "Y":
    for component in allcomponents:
      component[customercomponents[allcomponents.index(component)]][2] -= 1
    ordersplaced.append(customerdetails)
    customerdetails[0] = input("\n\nPlease enter your name:")
    customerdetails[1] = input("Please enter a phone number, so we may contact you about this order:")
    ordervaluetotal += (componenttotal*1.2)
    for repeat in range(2):
      print("\nOrder Number", estimatenumber)
      print("Order placed for", customerdetails[0], "contactable at", customerdetails[1], "on date", "%s╱%s╱%s" % (now.day, now.month, now.year))
      for component in allcomponents:
        print(component[0] + ":", component[customercomponents[allcomponents.index(component)]][0], "at $" + str(component[customercomponents[allcomponents.index(component)]][1]))
      print("Order total: $" + str(componenttotal*1.2), "\n\n")
  now = datetime.now()
print("Total number of orders made:", len(ordersplaced))
for component in allcomponents:
  print("\n" + component[0], "options:")
  for choice in component[1:]:
    print("Total number of", choice[0], "components sold:", (10-choice[2]))
print("\nTotal value of orders placed: $" + str(ordervaluetotal))