can anyone create a program for this?

In this program, you will be creating a very simple pizza-ordering menu. At this pizzeria, there�s only one kind of pizza you can order: regular (cheese,) no toppings. Your choices are what size of pizza, and how many of them. You�ll need to figure out the total price of the order. A small pizza costs \$7.99, a medium \$14.99, and a large \$18.99.

Here�s an example of a run of the program. The input (what you type) is in bold.

What size would you like?

a. small (\$7.99) b. medium (\$14.99) c. large (\$18.99)

Please enter a or b or c: b

Ok, medium, that is \$14.99 each

How many would you like? 2

Press enter to exit:

Coding the program

<!--[if !supportLists]-->1. <!--[endif]-->Input:

<!--[if !supportLists]-->1.1. <!--[endif]-->You will use two input variables: One to hold the letter of the size of pizza, another one to keep track of number of pizzas.

<!--[if !supportLists]-->1.2. <!--[endif]-->Since the response to the size question is a letter, you will need to use the raw_input() function to read it. You will also use raw_input() for the final �Press enter to exit:� message.

<!--[if !supportLists]-->1.3. <!--[endif]-->Since the user enters a number for how many pizzas they would like, you should the input() function to write the prompt and read the user�s answer.

<!--[if !supportLists]-->2. <!--[endif]-->Process:

<!--[if !supportLists]-->2.1. <!--[endif]-->You should have a third variable to hold the total price.

<!--[if !supportLists]-->2.2. <!--[endif]-->You should use an if-elif-else statement based on the price to determine which formula to use to calculate the total.

<!--[if !supportLists]-->3. <!--[endif]-->Output:

<!--[if !supportLists]-->3.1. <!--[endif]-->You can use the print function to write the �Your total �� line

## All 4 Replies

on python 2.7. thank you!

I think some student you know has studied Python programming, which is ideal for this. He surely want to show us his efforts of programming this :)

``````Let me help you order a pizza.

What size would you like?

a. small (\$7.99)  b. medium (\$14.99)  c. large (\$18.99)

Please enter a or b or c: b

Ok, medium, that is \$14.99 each

How many would you like? 2

Press enter to exit:``````

Give one good reason, why you should not able to code this, and why we should do this program. You are not going to learn anything and we are not satisfied to help, if you are not learning in the process. Joy of helper is in seeing others to 'get it'.

``````print'''

What size would you like?

a. small (\$7.99)  b. medium (\$14.99)  c. large (\$18.99)

Please enter a or b or c:'''
choice = 'a'
prices =  {'a':7.99}
print 'How many would you like?'
amount = 2
print 'Your total is %.2f'% (amount * prices[choice])``````
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.