Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- __author__ = "Foster Reichert"
- # Obviously this program is tuned according to the online IDE
- # It is not as efficient as it can be but I mean it works :)
- def main():
- # REPEATED VARIABLES
- amazon = " - [1] Amazon - $"
- logitech = " - [2] Logitech - $"
- bestBuy = " - [3] Best Buy - $"
- indent = " "
- tax = 0.065
- shipping = 5.99
- # KEYBOARD INFORMATION
- keyboard = "Logitech G513"
- keyboardAmazon = 129.99
- keyboardLogitech = 149.99
- keyboardBestBuy = 143.99
- keyboardStores = [amazon + str(keyboardAmazon), logitech + str(keyboardLogitech), bestBuy + str(keyboardBestBuy)]
- # MOUSE INFORMATION
- mouse = "Logitech G903"
- mouseAmazon = 129.99
- mouseLogitech = 149.99
- mouseBestBuy = 149.99
- mouseStores = [amazon + str(mouseAmazon), logitech + str(mouseLogitech), bestBuy + str(mouseBestBuy)]
- # MOUSE PAD INFORMATION
- mousePad = "Logitech G Powerplay"
- mousePadShort = "Logitech PPlay"
- mousePadAmazon = 119.99
- mousePadLogitech = 119.99
- mousePadBestBuy = 119.99
- mousePadStores = [amazon + str(mousePadAmazon), logitech + str(mousePadLogitech), bestBuy + str(mousePadBestBuy)]
- print("Receipt items:")
- # KEYBOARD PRICING
- print("")
- print(keyboard)
- for p in keyboardStores:
- print(p)
- 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)))
- if keyboardCost <= 1:
- keyboardCost = keyboardAmazon
- elif keyboardCost == 2:
- keyboardCost = keyboardLogitech
- elif keyboardCost >= 3:
- keyboardCost = keyboardBestBuy
- keyboardQuantity = input("How many keyboards do you want? [DEFAULT 1]")
- if keyboardQuantity == "":
- keyboardQuantity = 1
- keyboardNoTaxFinal = keyboardCost * int(keyboardQuantity)
- keyboardTax = keyboardNoTaxFinal * tax
- keyboardTaxFinal = keyboardTax + keyboardNoTaxFinal
- print("TOTAL = $" + str(round(keyboardNoTaxFinal, 2)))
- print("+ TAX = $" + str(round(keyboardTax, 2)))
- print("--------------------------")
- print("GROSS = $" + str(round(keyboardTaxFinal, 2)))
- print("--------------------------")
- # MOUSE PRICING
- print("")
- print(mouse)
- for p in mouseStores:
- print(p)
- 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)))
- if mouseCost <= 1:
- mouseCost = mouseAmazon
- elif mouseCost == 2:
- mouseCost = mouseLogitech
- elif mouseCost >= 3:
- mouseCost = mouseBestBuy
- mouseQuantity = input("How many mouses do you want? [DEFAULT 1]")
- if mouseQuantity == "":
- mouseQuantity = 1
- mouseNoTaxFinal = mouseCost * int(mouseQuantity)
- mouseTax = mouseNoTaxFinal * tax
- mouseTaxFinal = mouseTax + mouseNoTaxFinal
- print("TOTAL = $" + str(round(mouseNoTaxFinal, 2)))
- print("+ TAX = $" + str(round(mouseTax, 2)))
- print("--------------------------")
- print("GROSS = $" + str(round(mouseTaxFinal, 2)))
- print("--------------------------")
- # MOUSE PAD PRICING
- print("")
- print(mousePad)
- for p in mousePadStores:
- print(p)
- 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)))
- if mousePadCost <= 1:
- mousePadCost = mousePadAmazon
- elif mousePadCost == 2:
- mousePadCost = mousePadLogitech
- elif mousePadCost >= 3:
- mousePadCost = mousePadBestBuy
- mousePadQuantity = input("How many mousePads do you want? [DEFAULT 1]")
- if mousePadQuantity == "":
- mousePadQuantity = 1
- mousePadNoTaxFinal = mousePadCost * int(mousePadQuantity)
- mousePadTax = mousePadNoTaxFinal * tax
- mousePadTaxFinal = mousePadTax + mousePadNoTaxFinal
- print("TOTAL = $" + str(round(mousePadNoTaxFinal, 2)))
- print("+ TAX = $" + str(round(mousePadTax, 2)))
- print("--------------------------")
- print("GROSS = $" + str(round(mousePadTaxFinal, 2)))
- print("--------------------------")
- # FINAL CALCULATIONS
- print("")
- print("")
- print("END CALCULATIONS:")
- print("")
- endTotalNoShip = keyboardTaxFinal + mouseTaxFinal + mousePadTaxFinal
- endTotal = round(endTotalNoShip + shipping, 2)
- print(" SHIPPING = $" + str(shipping))
- print(" + TOTAL = $" + str(round(endTotalNoShip, 2)))
- print("--------------------------")
- print("YOUR TOTAL = $" + str(round(endTotal, 2)))
- print("--------------------------")
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement