Question: Please answer this question?? QUESTION 2 Harold Cohen is one of the most progressive private higher education institutions. Due to a high demand in computer


Please answer this question??
QUESTION 2 Harold Cohen is one of the most progressive private higher education institutions. Due to a high demand in computer science and engineering studies, the institution offers online classes to prospective students. The following diagram shows the inheritance hierarchy used in developing a course registration system for the institution. public class courseRegistration{ private String studentID; private String studentName; private int studentAge; private char studentGender; private int studentType; //1.undergraduate or 2.postgraduate Iormal constructor llaccessor methods I/mutator method //printer method //public double calculateFee () {...} onlineClass programCode: String + onlineClass(String, String, int, char, int, String) + getProgramCode(): String + setProgramCode(String): void + calculateFee(): double + toString(): String b) Write a complete class definition for onlineclass that includes the following methods: i. iv. A normal constructor. A mutator method to initialize its additional data member. An accessor method. An overriding printer method named toString() that displays information of online class. Processor method named calculateFee () that returns the price after discount. The fee is calculated based on the following table: v. Program Code Discount rate (%) Undergraduate Postgraduate COMP 40 30 ENG 35 25 *Basic fee for undergraduate and postgraduate are RM1600 and RM2100 respectively. (10 marks) c) Write the main program to perform the following tasks: i. Create an array of ONE HUNDRED (100) onlineClass objects named online. ji. Input and store all information about students into the array. iii. Update program code from ENG to COMP for student ID "2017111222". iv. Calculate and display the total fee collected from engineering program for undergraduate students. Display the program code enrolled by a student named "Alexander. V. (10 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
