Ask Question
4 July, 08:18

Create a program the outputs the total cost of a lunch order. Users should be prompted to input the number of hamburgers, fries, and drinks they want and the program should print the total cost of the order. The hamburgers cost 2.00, fries cost 1.50, and drinks cost 1.00. Be creative and professional in prompting the user for the information and in displaying the output.

+2
Answers (1)
  1. 4 July, 09:49
    0
    total = 0

    hamburgers = int (input ("Enter the number of hamburgers: "))

    fries = int (input ("Enter the number of fries: "))

    drinks = int (input ("Enter the number of drinks: "))

    total = (hamburgers * 2.0) + (fries * 1.5) + (drinks * 1.00)

    print ("The total cost of the order is: " + str (total))

    Explanation:

    - Ask the user for the inputs

    - In order to find the total cost, multiply each order cost with the number of orders. Then sum the each result.

    - Print the total cost
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Create a program the outputs the total cost of a lunch order. Users should be prompted to input the number of hamburgers, fries, and drinks ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers