What will. Be?
Chapter8: Arrays
Section: Chapter Questions
Problem 7PE
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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fde9fa7ea-201f-4d34-8fca-46b2d51addd1%2Ff89c9701-3a12-46e7-946d-196b0251f19f%2F3me1y79_processed.png&w=3840&q=75)
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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fde9fa7ea-201f-4d34-8fca-46b2d51addd1%2Ff89c9701-3a12-46e7-946d-196b0251f19f%2Fbof16kf_processed.png&w=3840&q=75)
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
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
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.Recommended textbooks for you
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr