A certain store gives its customers a discount on the goods they buy based on a peculiar manner.
The discount percentage is equal to each customer's remainder of weight to age, weight % age.
The maximum discount percentage allowed is 10.
If the remainder is greater than 10, the discount percentage is recomputed as the remainder of 10.
For example, a customer whose weight is 175 lbs and age 61, buys an item costing $60.97. The discount percentage = 175 % 61 = 53. As 53 is greater than 10, the discount percentage is recomputed as 53 % 10 = 3 percent.
Therefore, the discount amount is 0.03(60.97) = $1.83.
Write a class file calledlastname_discount.java. Write methods to compute and return the discount percentage, the discount amount for each customer and the sum of all the discount amounts.
Write a demo file calledlastname_discount_demo.java. Add two integer arrays containing the weight and age of customers and a double array containing the cost of goods (any number of customers greater than 10). Write an object to pass the three arrays into the class file and print the information returned by the three methods specified in the previous paragraph.
Extend the story line as you like (any reasonable) by clearly defining what it is. Add a fourth method (type your creation as a comment above the fourth method). Print the results of this fourth method below the first three outputs.