Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

File: happy_products . py Happy Products is an exciting new company that provides happy products to people who use their awesome new software.. But it's

image text in transcribedimage text in transcribed
File: happy_products . py Happy Products is an exciting new company that provides happy products to people who use their awesome new software.. But it's up to you to write this awesome new software. They want a menu with the options: . Instructions . Calculate . Quit When you calculate, you are asked how many products you want to buy and at what price (see how exciting this is?). If you buy 0-5 items, they're full price, over 5 items and each one is 10% off! Examples: . 5 x $10 products = $50 . 6 x $50 products = $270 Under 0 items is invalid and so are negative/$0 products, so keep prompting the user until they enter valid inputs. The menu should also handle invalid choices by printing "Invalid choice". The instructions are: Enter the number of products you want to buy and your chosen price. If you buy 0-5 items, they're full price, over 5 items and each one is 10% off! Sample Output Here is some sample output from a run of the program: Menu : (I )nstructions (C)alculate (Q)uit Choice: wREADME.md Menu: (I)nstructions (C)alculate (Q)uit Choice: w Invalid choice Menu: (I)nstructions (C)alculate (Q)uit Choice: I Enter the number of products you want to buy and your chosen price. If you buy 0-5 items, they're full price, over 5 items and each one is 10% off! Menu: (I)nstructions (C)alculate (Q)uit Choice: C Number of products: -1 Invalid input Number of products: 0 Price: 450.32 0 x $450.32 products = $0.00 Menu: (I)nstructions (C)alculate (Q)uit Choice: C Number of products: 3 Price: 12.34 3 x $12.34 products = $37.02 Menu : (I)nstructions (C)alculate Q)uit Choice: C Number of products: 6 Price: 100 6 x $100.00 products = $540.00 Menu: (I )nstructions C)alculate Quit Choice: q Farewell

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_2

Step: 3

blur-text-image_3

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

Transport Operations

Authors: Allen Stuart

2nd Edition

978-0470115398, 0470115394

Students also viewed these Programming questions