This is a Java assignment using netbeans. The deadline is 4/4/2021 by 11:59 pm. The instructions are as followed.
There exists a single-dimensional array of type String that holds the following values:
"FIVE_PERCENT"
"TEN_PERCENT"
"FIFTEEN_PERCENT"
"TWENTY_PERCENT"
"TWENTYFIVE_PERCENT"
Each of these array elements represent a promotion code at a popular website. To complete this assignment,
you are to declare and initialize the array describe above, then query the user for two (2) values:
1. Total Amount of Sale
2. Promotion Code
At this stage of learning, I expect data input to be validated using a loop structure. The promotion code is NOT
required. If the user enters nothing for the promotion code, the discount is zero (0).
Based upon the above information, you are to process the customer’s order by iterating the array using a loop
structure, applying the appropriate discount, if any, calculating and adding sales tax after the discount is
subtracted, and finally producing a receipt for the customer. Sales tax is a constant value of .075 or 7 ½ %.
Below are a few runs of the program:
Enter Your Bill Subtotal: 75.41
Enter Promotion Code: twenty_percent (note the case of my input)
Discount Applied: 20%
Bill SubTotal: 75.41
Discount Amt: - 15.08 (this data is formatted using 2 columns)
-------
After Discount: 60.33
Tax: + 4.52
-------
Total Bill: 64.85
Enter Your Bill Subtotal: 75.41
Enter Promotion Code: ten_percent
Discount Applied: 10%
Bill SubTotal: 75.41
Discount Amt: - 7.54
After Discount: 67.87
Tax: + 5.09
-------
Total Bill: 72.96
Enter Your Bill Subtotal: 58.75
Enter Promotion Code: (nothing entered here)
Discount Applied: 0%
Bill SubTotal: 58.75
Discount Amt: - 0.00
-------
After Discount: 58.75
Tax: + 4.41
-------
Total Bill: 63.16
Once you are completed, save the source code file (.java).
Get Free Quote!
406 Experts Online