Question: Open with Google Docs QUESTION 2 (30 MARKS) public abstract class Sales protected double price; protected char shoeBrand; // brand A or B or C

 Open with Google Docs QUESTION 2 (30 MARKS) public abstract class

Sales protected double price; protected char shoeBrand; // brand A or B

or C protected int quantity; //Methods: //constructors, accessor, toString() abstract double netPrice();

Open with Google Docs QUESTION 2 (30 MARKS) public abstract class Sales protected double price; protected char shoeBrand; // brand A or B or C protected int quantity; //Methods: //constructors, accessor, toString() abstract double netPrice(); } public class NewYear extends Sales 1 private boolean isAdult; //true for adult false for // kid's shoes //Methods: //constructors, accessor, toString() public double netPrice () {...} public class EndYear extends Sales t private boolean isMember; //true or false //Methods: //constructors, accessor, toString() public double netPrice () } Given the following super class and subclasses for KedaiKasutKita sales: a) Write the following method definition: i) Normal constructor for both subclasses. (6 marks) ii) Process method named net Price () for both subclasses that calculate and return the net price based on following information: The net price for New Year sales is calculated based on adult category by using the Table 2: Adult yes no Table 2 Percent Discount (%) 12 7 The net price for End of Year sales is given based on customer membership by using the Table 3: Table 3 Membership Percent Discount (%) yes 20 10 no (9 marks) b) Write fragment codes in application that perform the following tasks: 1) Declare an array of object named sales where the size of array is entered by the user. (2 marks) ii) Calculate and display the total net price of every category of sales (every subclass) (5 marks) iii) Determine the highest net price for End of Year Sale for shoes Brand A and display information about the End of Year Sale using toString() method. (8 marks)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!