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:
- 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).
- 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: David, 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started