Ask 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 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.

+3
Answers (1)
  1. 14 December, 01:00
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers