Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please solve this Python 3 : Ask the user what size cup they want, choosing between small, medium, and large. Ask the user what kind

Please solve this Python 3 :

  1. Ask the user what size cup they want, choosing between small, medium, and large.
  2. Ask the user what kind of coffee they want, choosing between brewed, espresso, and cold brew.
  3. Ask the user what flavoring they want, if any. Choices include hazelnut, vanilla, and caramel.
  4. Calculate the price of the cup using the following values:
    • Size:
      • small: $2
      • medium: $3
      • large: $4
    • Type:
      • brewed: no additional cost
      • espresso: 50 cents
      • cold brew: $1
    • Flavoring:
      • None: no additional cost
      • All other options: 50 cents
  5. Display a statement that summarizes what the user ordered.
  6. Display the total cost of the cup of coffee as well as the cost with a 15% tip, in phrases that explain the values to the user. Round the cost with tip to two decimal places.
    • For example, if the user asks for a medium-sized espresso with hazelnut flavoring, the total should be $4; the total with a tip should be $4.60.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

Students also viewed these Databases questions