Advertisement
Guest User

2.06 Module Two Project - Foster Reichert

a guest
Apr 9th, 2020
556
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.87 KB | None | 0 0
  1. __author__ = "Foster Reichert"
  2.  
  3. # Obviously this program is tuned according to the online IDE
  4. # It is not as efficient as it can be but I mean it works :)
  5.  
  6. def main():
  7.     # REPEATED VARIABLES
  8.     amazon = " - [1] Amazon - $"
  9.     logitech = " - [2] Logitech - $"
  10.     bestBuy = " - [3] Best Buy - $"
  11.     indent = "                                 "
  12.     tax = 0.065
  13.     shipping = 5.99
  14.    
  15.     # KEYBOARD INFORMATION
  16.     keyboard = "Logitech G513"
  17.     keyboardAmazon = 129.99
  18.     keyboardLogitech = 149.99
  19.     keyboardBestBuy = 143.99
  20.     keyboardStores = [amazon + str(keyboardAmazon), logitech + str(keyboardLogitech), bestBuy + str(keyboardBestBuy)]
  21.    
  22.     # MOUSE INFORMATION
  23.     mouse = "Logitech G903"
  24.     mouseAmazon = 129.99
  25.     mouseLogitech = 149.99
  26.     mouseBestBuy = 149.99
  27.     mouseStores = [amazon + str(mouseAmazon), logitech + str(mouseLogitech), bestBuy + str(mouseBestBuy)]
  28.    
  29.     # MOUSE PAD INFORMATION
  30.     mousePad = "Logitech G Powerplay"
  31.     mousePadShort = "Logitech PPlay"
  32.     mousePadAmazon = 119.99
  33.     mousePadLogitech = 119.99
  34.     mousePadBestBuy = 119.99
  35.     mousePadStores = [amazon + str(mousePadAmazon), logitech + str(mousePadLogitech), bestBuy + str(mousePadBestBuy)]
  36.  
  37.     print("Receipt items:")
  38.    
  39.     # KEYBOARD PRICING
  40.     print("")
  41.     print(keyboard)
  42.     for p in keyboardStores:
  43.         print(p)
  44.     keyboardCost = int(input("Where would you like to get " + keyboard + " from?" + indent + "[1] Amazon - $" + str(keyboardAmazon) + ", [2] Logitech - $" + str(keyboardLogitech) + ", [3] Best Buy - $" + str(keyboardBestBuy)))
  45.     if keyboardCost <= 1:
  46.         keyboardCost = keyboardAmazon
  47.     elif keyboardCost == 2:
  48.         keyboardCost = keyboardLogitech
  49.     elif keyboardCost >= 3:
  50.         keyboardCost = keyboardBestBuy
  51.     keyboardQuantity = input("How many keyboards do you want? [DEFAULT 1]")
  52.     if keyboardQuantity == "":
  53.         keyboardQuantity = 1
  54.     keyboardNoTaxFinal = keyboardCost * int(keyboardQuantity)
  55.     keyboardTax = keyboardNoTaxFinal * tax
  56.     keyboardTaxFinal = keyboardTax + keyboardNoTaxFinal
  57.     print("TOTAL = $" + str(round(keyboardNoTaxFinal, 2)))
  58.     print("+ TAX = $" + str(round(keyboardTax, 2)))
  59.     print("--------------------------")
  60.     print("GROSS = $" + str(round(keyboardTaxFinal, 2)))
  61.     print("--------------------------")
  62.    
  63.     # MOUSE PRICING
  64.     print("")
  65.     print(mouse)
  66.     for p in mouseStores:
  67.         print(p)
  68.     mouseCost = int(input("Where would you like to get " + mouse + " from?" + indent + "[1] Amazon - $" + str(mouseAmazon) + ", [2] Logitech - $" + str(mouseLogitech) + ", [3] Best Buy - $" + str(mouseBestBuy)))
  69.     if mouseCost <= 1:
  70.         mouseCost = mouseAmazon
  71.     elif mouseCost == 2:
  72.         mouseCost = mouseLogitech
  73.     elif mouseCost >= 3:
  74.         mouseCost = mouseBestBuy
  75.     mouseQuantity = input("How many mouses do you want? [DEFAULT 1]")
  76.     if mouseQuantity == "":
  77.         mouseQuantity = 1
  78.     mouseNoTaxFinal = mouseCost * int(mouseQuantity)
  79.     mouseTax = mouseNoTaxFinal * tax
  80.     mouseTaxFinal = mouseTax + mouseNoTaxFinal
  81.     print("TOTAL = $" + str(round(mouseNoTaxFinal, 2)))
  82.     print("+ TAX = $" + str(round(mouseTax, 2)))
  83.     print("--------------------------")
  84.     print("GROSS = $" + str(round(mouseTaxFinal, 2)))
  85.     print("--------------------------")
  86.    
  87.     # MOUSE PAD PRICING
  88.     print("")
  89.     print(mousePad)
  90.     for p in mousePadStores:
  91.         print(p)
  92.     mousePadCost = int(input("Where would you like to get " + mousePadShort + " from?" + indent + "[1] Amazon - $" + str(mousePadAmazon) + ", [2] Logitech - $" + str(mousePadLogitech) + ", [3] Best Buy - $" + str(mousePadBestBuy)))
  93.     if mousePadCost <= 1:
  94.         mousePadCost = mousePadAmazon
  95.     elif mousePadCost == 2:
  96.         mousePadCost = mousePadLogitech
  97.     elif mousePadCost >= 3:
  98.         mousePadCost = mousePadBestBuy
  99.     mousePadQuantity = input("How many mousePads do you want? [DEFAULT 1]")
  100.     if mousePadQuantity == "":
  101.         mousePadQuantity = 1
  102.     mousePadNoTaxFinal = mousePadCost * int(mousePadQuantity)
  103.     mousePadTax = mousePadNoTaxFinal * tax
  104.     mousePadTaxFinal = mousePadTax + mousePadNoTaxFinal
  105.     print("TOTAL = $" + str(round(mousePadNoTaxFinal, 2)))
  106.     print("+ TAX = $" + str(round(mousePadTax, 2)))
  107.     print("--------------------------")
  108.     print("GROSS = $" + str(round(mousePadTaxFinal, 2)))
  109.     print("--------------------------")
  110.  
  111.     # FINAL CALCULATIONS
  112.     print("")
  113.     print("")
  114.     print("END CALCULATIONS:")
  115.     print("")
  116.     endTotalNoShip = keyboardTaxFinal + mouseTaxFinal + mousePadTaxFinal
  117.     endTotal = round(endTotalNoShip + shipping, 2)
  118.     print(" SHIPPING = $" + str(shipping))
  119.     print(" +  TOTAL = $" + str(round(endTotalNoShip, 2)))
  120.     print("--------------------------")
  121.     print("YOUR TOTAL = $" + str(round(endTotal, 2)))
  122.     print("--------------------------")
  123.  
  124. if __name__ == "__main__":
  125.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement