Ask Question
15 April, 09: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. 15 April, 12:42
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers