Question: Create the follow program using Python. Use the concepts, techniques and good programming practices (example: using modular structure, using input validations....). You have unlimited attempts

Create the follow program using Python. Use the concepts, techniques and good programming practices (example: using modular structure, using input validations....). You have unlimited attempts for this part of the exam.

A retail price for each basket ball is $2.99/each.

You have to write a program to figure it out the final bill for each customer after discount (if applicable)

+ Customers buy less than 5 balls, there will be no discount.

+ Customers buy >= 5 and less than 10 balls, there will be 10% discount.

+ Customers buy >= 10 and less than 20 balls, there will be 20% discount.

+ Customers buy >= 20 and less than 30 balls, there will be 30% discount.

+ Customers buy >= 30 balls, there will be 40% discount.

Write a program to: Get input from users for a list of customers names, each customer with a specific quantity ordered, store names and quantities into parallel arrays named customers and quantities. End the input with a sentinel value. Apply the defensive technique to verify input quantities are positive integer numbers (Hint: Read slides for module 5 to know more about defensive technique and input validation). After completing all the inputs, your program will figure it out the discount rate of each customer and the final bill for each of them (after discount). The output will be customer names, quantities ordered, discount rates, and final bill Example: Name: Adam, Quantities Ordered: 4, Discount Rate: 0%, Final Bill: $11.96 Hint: Again, you maintain a 2 parallel arrays (QUAN_LIMITS and DISCOUNTS), apply what you studied in module 6 with parallel arrays and ranges: To get maximum point, you have to use input validation (quantities must be positive integer numbers ) and use searching an array for a range match (NOT nested selection).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!