What will. Be?

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 7PE
icon
Related questions
Question

What will. Be? 

 

CASE STUDY
As a programmer in a software company, you are required to develop a JAVA program
for the course training modules. The details of a course include the course name,
course code, and total hours. The class has a constructor that initializes all the course
details. The class also contains an abstract method that returns the total fee.
The online course is the course that will be conducted online. In addition to the data of a
course, the online course has the data including course passwords. The constructor
initializes all the course details.
On the other hand, face to face course is a course which is conducted at the training
center. In addition to the data of a course, the face-to-face course has the data
including course room number and participant quota. The room number is not
accessible by other classes. The constructor initializes the course name, course code,
and total hours. Besides, the class has setter and getter methods.
All the classes have a method to display ALL data belonging to each class. An interface
will be created that consists of fee per hour and meal fee. The fee per hour is RM50.90,
and the meal fee is RM15.
QUESTION
a) Implement ALL classes and interface by using an appropriate object-oriented
principle. Table 1 shows the formula to calculate course fees for a different course.
Table 1: Course Fees
Course
Online course
Face-to-face course
Course fees
fee = fee per hour * total hour
fee = (fee per hour * total hour) + meal fee
Transcribed Image Text:CASE STUDY As a programmer in a software company, you are required to develop a JAVA program for the course training modules. The details of a course include the course name, course code, and total hours. The class has a constructor that initializes all the course details. The class also contains an abstract method that returns the total fee. The online course is the course that will be conducted online. In addition to the data of a course, the online course has the data including course passwords. The constructor initializes all the course details. On the other hand, face to face course is a course which is conducted at the training center. In addition to the data of a course, the face-to-face course has the data including course room number and participant quota. The room number is not accessible by other classes. The constructor initializes the course name, course code, and total hours. Besides, the class has setter and getter methods. All the classes have a method to display ALL data belonging to each class. An interface will be created that consists of fee per hour and meal fee. The fee per hour is RM50.90, and the meal fee is RM15. QUESTION a) Implement ALL classes and interface by using an appropriate object-oriented principle. Table 1 shows the formula to calculate course fees for a different course. Table 1: Course Fees Course Online course Face-to-face course Course fees fee = fee per hour * total hour fee = (fee per hour * total hour) + meal fee
a) Write a program that demonstrates the classes by creating an object for each
online course and face-to-face course. Use the data shown in Table 2 and Table 3 to
demonstrate your solution. For the face-to-face course, the program will ask users to
enter the room number and the participant quota.
Table 2: Online Course
Item
Course name
Course code
Total hours
Password
Item
Course name
Course code
Output example:
Total hours
Room number
Participant quota
Online course details
Name: Java
Table 3: Face to Face Course
Code: 30123
Total hours: 2.5
Password: Java_30123
Fee: RM127.25
Value
Java
J0123
2.5
Java_J0123
What is the room number?
F503
Room number: F503
Participant quaota: 30
Fee: RM167.70
Value
PhP
P0234
3
F503
30
What is the participant quota?
30
Face to face course details
Name: Php
Code: P0234
Total hours: 3.0
Transcribed Image Text:a) Write a program that demonstrates the classes by creating an object for each online course and face-to-face course. Use the data shown in Table 2 and Table 3 to demonstrate your solution. For the face-to-face course, the program will ask users to enter the room number and the participant quota. Table 2: Online Course Item Course name Course code Total hours Password Item Course name Course code Output example: Total hours Room number Participant quota Online course details Name: Java Table 3: Face to Face Course Code: 30123 Total hours: 2.5 Password: Java_30123 Fee: RM127.25 Value Java J0123 2.5 Java_J0123 What is the room number? F503 Room number: F503 Participant quaota: 30 Fee: RM167.70 Value PhP P0234 3 F503 30 What is the participant quota? 30 Face to face course details Name: Php Code: P0234 Total hours: 3.0
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Database Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT