Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA QUESTION 2 Harold Cohen is one of the most progressive private higher education institutions. Due to a high demand in computer science and engineering

JAVA

image text in transcribed

image text in transcribed

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 student ID; private String student.Name; private int studentAge; private char student Gender: private int studentType; //1.undergraduate or 2.postgraduate Iormal constructor l/accessor methods Ilmutator method l/printer method // public double calculate Fee () (...) onlineClass - programCode: String - onlineClass(String, String int, char, int, String) + getProgramCode(): String - setProgramCode(String) void calculateFeel): double toString(): String b) Write a complete class definition for onlineclass that includes the following methods: 1. A normal constructor. ii. A mutator method to initialize its additional data member. lil. An accessor method. iv. An overriding printer method named toString() that displays information of online class. v. Processor method named calculateFee () that returns the price after discount The fee is calculated based on the following table: 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)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Robb,Carlos Coronel

5th Edition

061906269X, 9780619062699

More Books

Students also viewed these Databases questions

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago