Académique Documents
Professionnel Documents
Culture Documents
You have to write a program that will help your university to calculate the
hostel’s fee for every student. There are two types of students’ mode; either
fulltime or part time. Currently there are three main hostels in the university:
Melewar, Perwira, Tun Dr. Ismail (TDI). Each hostel has different types of room
with different rate. This program should be able to produce a report that
consist of the fees that will be charged to the student based on types of the
hostel and room chosen. In addition, full time student will be charged per
semester, while part time student will be charged per day. Assumed that full
time student has to pay the fee yearly (2 sem). The charge is based on the
following rate:
STUDY MODE HOSTEL ROOM TYPE RATE (per sem)
A RM 450.00
Melewar B RM 430.00
C RM 400.00
A RM 420.00
Full Time Perwira B RM 400.00
C RM 370.00
A RM 410.00
Tun Dr. Ismail B RM 390.00
C RM 360.00
STUDY MODE HOSTEL ROOM TYPE RATE (per day)
A RM 50.00
Melewar B RM 40.00
C RM 30.00
A RM 45.00
Part Time Perwira B RM 35.00
C RM 25.00
A RM 40.00
Tun Dr. Ismail B RM 30.00
C RM 20.00
Sample Output
Student’s Name : _________________________________
Study Mode : _____________________________________
Hostel Name : ____________________________________
Room Type : _____________________________________
Total Day (part time student) : ______________________
Total Fee : _______________________________________
1. [20 points] Identify the classes (together with attributes and behaviors) and
data structures that you need to implement based on the information given.
2. [10 points] Put the classes that you have identified in (1) in an inheritance
hierarchy and explain your choice of the particular arrangement of the
hierarchy.
3. [50 points] Write a program to implement each of class identified (Note: You
must use inheritance mechanism in your program. You must have minimum 3
classes).
4. [20 points] Create another program (for main function) that instantiates the
class identified and call the methods in class identified.