pizza price by size

Helo guys.
How can i write a program that allows a user to enter a size of pizza and then print the price for that size.
Example: if a user enters size ''s'' then it should display the price stored under ''s''
What's exactly are you asking for? Can you be more specific?
Asking the user stuff:
http://www.cplusplus.com/doc/tutorial/basic_io/

Displaying the price depending on the user input:
http://www.cplusplus.com/doc/tutorial/control/

Depends on which programming language you are using but logic is essentially the same for all:

'Initialize Variables
Base_Type = Character ' (S) Small, (M) Medium, (L) Large
Base_Price = number 'Base Price
Top_Num = number 'number of toppings
Sub-Total = number 'Base Price + Tax

:Startover:
'Get input
Input " Pizza Size (S,M or L)" ,Base_Type
Input "Number of Toppings" , Top_Num

If Base_Type = "S" then Base_Price = 8.50
If base_Type = "M" then Base_Price = 10.50
If Base_Type = "L" then Base_Price = 12.50
if Base_Type not equal to "S" or "M" or "L" then goto Startover
Tax = .07*(Base_Price+(Top_Num *.5 -.5))

Print "Pizza Size ", Base_Type, " $"Base_Price
Print "Number of Toppings ", Top_Num, "$",Top_Num*.5-.5
Print "Tax $" ,Tax
Print "Total $", Base_Price + Tax + Tot_Num *.5 -.5

End Program
Topic archived. No new replies allowed.