The objectives of this question are
A training institution has invited your team to build a computerized system to record its courses and students. You have been tasked to develop a prototype based on the user specifications and the design proposed by your team.
A course consists of formal lessons. It has a unique course code, a title, fees and duration. Applied courses are courses that include a practicum in a related industry. Data for some courses is given in Table (1) below: See image.
Courses are offered and scheduled regularly. Data for some course offering is given in Table (2) below: See image.
Your team proposed that each course offering also records the course for the course offering,
Students, both local and international, can enrol in any course, whether applied or otherwise. Students choose a course offering by selecting the course code and start date of the course they wish to enrol in, from the list of the course offerings that are open for enrolment. A course offering is open or close at the discretion of the administrator to facilitate international students. However, the course offering is always made close whenever the vacancy reaches 0.
An international student must apply for a student pass when enrolled in a course where the duration exceeds 4 weeks. A check must be made at enrolment time so that the requirement can be displayed if an international student selects to enrol in such a course.
The enrolment process completes when students make an online payment. All local students pay a fixed 30% non-refundable deposit but international students pay 50% deposit because of their foreign status. However, the additional 20% is refunded if the student pass application is not approved. The team has decided to implement the required deposit percentages as constants.
The course offering will record the list of students who have enrolled in it. At the same time, a single course offering that a student has enrolled in will also be part of the student record.
A student must be successfully registered before enrolling in any course. The following data is recorded during registration: student number, name, date registered and identification number (NRIC for local and passport number for international students). The student pass number, subsequently obtained for international students enrolled in course with duration exceeding 4 weeks, must be recorded before the commencement of the course.
Data for some students is given in Table (3) below: See image.
You are given the following fragment of a class diagram in Figure 1and an extract of the description of the classes for the system follows. See image.
Class Course: This class models a course in the training institution. There are two types of courses: Course and AppliedCourse. Every course has a unique code (String), title (String), fees (double), lessonDuration (int).
Class AppliedCourse: This class is a subclass of Course. It models an applied course in the training institution. In addition to the attributes it inherits from the superclass, it includes a practicumDuration (int). All applied courses have a practicum with a specified duration
Class CourseOffering: This class models a course scheduled and offered in the training institution. It has the course (Course) the course offering is for, startDate (GregorianCalendar), whether the course offering is isOpen (boolean) , the current vacancy (int) and a collection that records the studentList (ArrayList
Class Student: This class models a student in the training institution. There are only two types of students: LocalStudent and InternationalStudent. Every student has a unique studentNumber (int), name (String), dateRegistered (GregorianCalendar) , id (String) and courseEnrolled (CourseOffering).
studentNumber is a system-generated running number starting with 1 for the first student, incremented by 1 for each subsequent student, and is to be displayed with the width of 8, with leading zeroes such as 00000001.
Class LocalStudent: This class is a subclass of Student. It models a local student in the training institution. It has no additional attribute apart from what it inherits from the superclass.
This class has a constant DEPOSIT_PERCENT to record the fixed percentage (0.3) for the deposit required for all local students.
Class InternationalStudent: This class is a subclass of Student. It models an international student in the training institution. In addition to the attributes it inherits from the superclass, it has a studentPass (String) to record the student pass number.
This class also has two constants: DEPOSIT_PERCENT and R_DEPOSIT_PERCENT to record the fixed percentage (0.5) for the deposit required and for refundable percentage (0.2) respectively for all international students.
Class TrainingInstitution: This class models the training institution. It has three collections: courses (ArrayList < Course>), offerings (ArrayList < CourseOffering>) and students (ArrayList < Student>).
Implement the Java class for Student as an abstract class. You should include the following in the class:
Below is an example in the required format:
00000001 Ishak Ahmad 24/2/2015 S9211111C
Implement the two Java subclasses of Student: LocalStudent and InternationalStudent. You should include the following in the classes:
- for local student:
00000001 Ishak Ahmad 24/2/2015 S9211111C
- for international student
00000003 Viva Sujurono 24/2/2015 D1122311A Not Obtained
Implement the Java class for Course. You should include the following in the class:
Code: C111 Title: Basic Copywriting Fees(SGD): $535.00
Lesson Duration: 2 wks
Implement the Java subclass of Course: AppliedCourse. You should include the following in the class:
Code: AC111 Title: Creating Newsletters Fees(SGD): $1872.50
Lesson Duration: 1 wk Practicum Duration: 3 wks
Implement the Java class CourseOffering. You should include the following in the class:
Code: C111 Title: Basic Copywriting Fees(SGD): $535.00
Lesson Duration: 2 wks
Start Date: 24/8/2015 Status: Close Vacancy: 20
- for a course offering with no student enrolled:
Code: C111 Title: Basic Copywriting Fees(SGD): $535.00
Lesson Duration: 2 wks
Start Date: 24/8/2015 Status: Close Vacancy: 20 No students enrolled
- for a course offering with student(s) enrolled:
Code: AC222 Title: DigiFilm Production Fees(SGD): $16050.00
Lesson Duration: 24 wks
Practicum Duration: 36 wks
Start Date: 4/5/2015 Status: Open Vacancy: 2
Student Number Name Date Reg. ID Student Pass
00000003 Viva Sujurono 24/2/2015 D1122311A Not Obtained
00000001 Ishak Ahmad 24/2/2015 S9211111C
Complete the Java class TrainingInstitution given in appendix A as your prototype. Modify it to include the following methods:
Menu ====
1. Enrol Course
2. List Course Offerings
0. Exit
Option: 2
Course Offering List
====================
Code: C111 Title: Basic Copywriting Fees(SGD): $535.00
Lesson Duration: 2 wks
Start Date: 20/4/2015 Status: Open Vacancy: 3
No students enrolled
Code: C111 Title: Basic Copywriting Fees(SGD): $535.00
Lesson Duration: 2 wks
Start Date: 24/8/2015 Status: Close Vacancy: 20
No students enrolled
Code: C222 Title: MSWord Processing Fees(SGD): $192.60
Lesson Duration: 1 wk
Start Date: 20/4/2015 Status: Close Vacancy: 0
No students enrolled
Code: AC111 Title: Creating Newsletters Fees(SGD): $1872.50
Lesson Duration: 1 wk Practicum Duration: 3 wks
Start Date: 27/4/2015 Status: Close Vacancy: 0
Student Number Name Date Reg. ID Student Pass
00000005 Irene Peters 26/2/2015 H1122313H Not Obtained
A sample output is shown here:
Available Course Offerings
==========================
Code: C111 Title: Basic Copywriting Fees(SGD): $535.00
Lesson Duration: 2 wks
Start Date: 20/4/2015 Status: Open Vacancy: 3
You should make use of methods for individual task to make your program easier to follow. For each task, design your own interface, if necessary, and ensure that it is clear and friendly. You are not required to perform input validation except for those described. Therefore, do ensure that you enter only valid input when you execute the program at points where there is no validation.
Submit your program listing and the screenshot of the output to convince your tutor that your program is working. Your screenshot must show your name and student number.
Give an example of the following concepts used in the Java code for Question 1(a) to (f)