Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #35543
| Newsgroups | comp.lang.python |
|---|---|
| Date | 2012-12-26 13:40 -0800 |
| Message-ID | <5faf1b05-d70a-4e63-8973-e9e7d7f33ca6@googlegroups.com> (permalink) |
| Subject | Can you please help me? |
| From | bobflipperdoodle@gmail.com |
I really hope you can help!
I need to create a program where the user can order any combination and quantity of 3 products. I then offer a 10% discount if the customer correctly answers a trivia question. After that, there are 3 choices for shipping.
I have most of the program completed but I'm struggling with the most important parts :/ I get the total of multiple orders of the same item, but we can't figure out how to total the entire order - before discounts and shipping - and then where to put any code referring back to the trivia question. Can somebody please help me with this? I would really appreciate it!
This is the code:
shop_again = 'y'
print("Welcome to the Star Wars Shop!")
customer = eval(input("Is there a customer in line? (1 = yes, 2 = no)> "))
while shop_again == 'y':
if (customer == 2):
print("Welcome to the Star Wars Memorabilia Shop!")
customer = eval(input("Is there a customer in line? (1 = yes, 2 = no)> "))
elif (customer == 1):
print("Please select an item to update your order and any other number to check out.")
print("Yoda Figure: $10 each.")
print("Star Wars Movie DVD: $20 each.")
print("Death Star Lego Set: $200 each.")
print(" 1 for Yoda Figure")
print(" 2 for Star Wars Movie DVD")
print(" 3 for Death Star Lego Set")
order = eval(input("Order: "))
if (order == 1):
yoda = eval(input("How many Yoda Figures do you want? : "))
total = 10 * yoda
print("Total:", total)
print("Current order:", yoda, "at", total)
if (order == 2):
movie = eval(input("How many Star Wars Movie DVDs do you want? : "))
total = 20 * movie
print("Total:", total)
print("Current order:", movie, "at", total)
if (order == 3):
legos = eval(input("How many Death Star Lego Sets do you want? : "))
total = 200 * legos
print("Total:", total)
print("Current order:", legos, "at", total)
shop_again = input("Would you like to keep shopping? 'Y' for yes, 'N' for no: ")
print()
print("Your order before shipping and discounts: ",total)
print()
print("Answer a trivia question for a discount!")
discount = eval(input("On what planet did Yoda live when Luke Skywalker first met him? 1) Earth 2) Dagobah 3) Pluto :"))
if (discount == 1):
print("Sorry, that answer was wrong!")
if (discount == 2):
print("That's correct, you get a 10% discount!")
if (discount == 3):
print("Sorry, that answer was wrong!")
print()
if (discount == 2):
(total * .9)
print("Your total before shipping: ",total)
print("1) Regular Shipping: 3-4 business days, $5.00 per $50 ordered. 2) Express Shipping: overnight, $10 per $50 ordered. 3) Super Saver Shipping: 7-10 business days, free.")
shipping = eval(input("Please select the shipping method you want: "))
if (shipping == 1):
total == total % 50
total == total * 5
print("Your total is: ",total)
if (shipping == 2):
total == total/50
total == total % 50
total == total * 10
print("Your total is: ",total)
if(shipping == 3):
print("Your total is: ",total)
print()
print("Thanks for shopping here! Please come again!")
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Can you please help me? bobflipperdoodle@gmail.com - 2012-12-26 13:40 -0800
Re: Can you please help me? Mitya Sirenef <msirenef@lightbird.net> - 2012-12-26 18:05 -0500
Re: Can you please help me? bobflipperdoodle@gmail.com - 2012-12-26 15:21 -0800
Re: Can you please help me? Mitya Sirenef <msirenef@lightbird.net> - 2012-12-26 18:37 -0500
Re: Can you please help me? Ian Kelly <ian.g.kelly@gmail.com> - 2012-12-26 17:00 -0700
Re: Can you please help me? bobflipperdoodle@gmail.com - 2012-12-26 15:21 -0800
csiph-web