Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create the follow program using Raptor or Python (if you do with both python and raptor correctly, you will get 30 bonus points for this
Create the follow program using Raptor or Python (if you do with both python and raptor correctly, you will get 30 bonus points for this assignment). 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 $2.99/each. 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.
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 (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).
SUBMISSION:
1. Submit your source code file either in raptor file (*.rap) or python file (*.py) or both.
2. In case you work with python, you also have to submit screen shots demonstrating your program works correctly. Any program that requires user input should be run a minimum of three times with varying test values.
Documentation is very important for this course and in the field. For all Raptor and all programs, an expectation is that comments will be incorporated into all assignments. For this assignment only the header comments will be required. Both header comments and step comments are encouraged as it will help for logic to be better. Header comments should include the following:
Name of the submission
Author of the submission
Summary/goal of the submission
Variables used with a short description of the variable, as well as the format of the data (e.g. datatype)
A retail price for each basket ball is $2.99/each. 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.
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 (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).
SUBMISSION:
1. Submit your source code file either in raptor file (*.rap) or python file (*.py) or both.
2. In case you work with python, you also have to submit screen shots demonstrating your program works correctly. Any program that requires user input should be run a minimum of three times with varying test values.
Documentation is very important for this course and in the field. For all Raptor and all programs, an expectation is that comments will be incorporated into all assignments. For this assignment only the header comments will be required. Both header comments and step comments are encouraged as it will help for logic to be better. Header comments should include the following:
Name of the submission
Author of the submission
Summary/goal of the submission
Variables used with a short description of the variable, as well as the format of the data (e.g. datatype)
Step by Step Solution
★★★★★
3.45 Rating (155 Votes )
There are 3 Steps involved in it
Step: 1
Here is a Python program that calculates the final bill for each customer based on the quantity of b...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