Question: Create the follow program using Raptor Avalonia. Use the concepts, techniques and good programming practices that you have learned in the course (example: using modular

Create the follow program using Raptor Avalonia.  Use the concepts, techniques and good programming practices that you have learned in the course (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 $1.99/each. You have to write the program to figure it out the final bill for each customer after discount (if applicable)

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

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

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

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

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

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

Write the program to:

  1. Get input from users for a list of customer's 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. For example: when user enter -4 (negative number), 1.7 (floating point number) or forty (string), the program will force them to enter the correct value again. (Hint: Read slides for module 5 to know more about defensive technique and input validation).
  2. 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:

NameDavid, Quantities Ordered: 8, Discount Rate: 0%, Final Bill: $15.92

Name: Jake: Quantities Ordered: 20, Discount Rate: 20%, Final Bill: $31.840

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 ), use modular structure and use the loop to search 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 Algorithms Questions!