You work for The Cutting Edge Rental Company (CER). They need an application that will determine the cost of rental for their customers. They only rent four different items. The items and their per day rental fees appear below. See image.

CER has a discount system that alters this basic price. CER rents to both retail and wholesale customers. Wholesale customers get a 25% discount. Retail customers get a discount that varies according to how many different kinds of items they rent, how many different units they rent and for how long they rent the item(s). See image.

Additional business rules:

  • Retail customers shall not receive a higher discount than wholesale customers (25%).
  • All sales will be assessed a 6% sales tax.

Considerations and some things that you must do.

  • You must write your application using variables for all of the input values.
  • You must write your application using structured principles that we have discussed this term, including modularization.
  • You must use sequence and alternation somewhere in your application.
  • The discount rate should be output as a percentage figure. To do this, multiply it by 100.
  • The output should look like the following.
Your total Cost for ___ number of item(s) for ___ number of day(s) is _____
plus tax.
This reflects a ___ % discount of _____ .
Your bill is _____ . This includes a 6 % tax of ______ .
You are a valued wholesale/retail customer of ours.

The last sentence says either “wholesale” or “retail” based on the user's entry.

Examples:

Chain Saw 1
Lawn Mower 0
Trimmer 0
Chipper 0
Number of days 1
Wholesale customer left blank
No discount for one kind of an item, one unit and less than two days.
Chain Saw 1
Lawn Mower 2
Trimmer 1
Chipper 3
Number of days 3
Wholesale customer left blank
1 chainsaw = 20
2 lawn mowers = 30
1 trimmer = 10
3 chippers = 90
total = 150
at 3 days = 150 * 3 = 450
Not wholesale, therefore the following discounts apply.
Total number of different kinds of items = 4 - discount of 10 %
Total number of units rented = 7 - discount of 6 %
Total number of days = 3 and a chipper is rented which is worth 3%
per day
therefore 2 days times 3% = 6% (first day is not counted)
Then 10 + 6 + 6 = 22 % total discount.
Discount amount = 450 * .22 = 99.00
Charge for rentals = 450 - 99 = 351.00
Tax = 351 * .06 = 21.06
Final bill = 351 + 21.06 = 372.06
Chain Saw 3
Lawn Mower 2
Trimmer 4
Chipper 2
Number of days 5
Wholesale customer left blank
When the retail customer's discount rate exceeds 25%, 25% discount is
applied.

The output See image.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.