Computers and Technology

1. Create a class named FacultyCourse
Data fields:
• department (for example, ENG),
• courseId (for example, CSCI1306),
• credits (for example, 3)
• fee computed at per credits
• CHARGE: constant value (e. g., $ 120) for all courses
• numberOfCourses: holds the number of created courses
• profitRate data field (double value less than 1 greater than zero (0-1)) .
Methods :
• constructor ():
All of the fields are required as arguments to the constructor, except for the fee, which is computed at
fee = credits * charge
e. g., fee = 3 * $120 = $360).
• The necessary set and get methods
• display () method that displays the course data.
• getProfit () method return the course profit
profit = profitRate*fee
2. Create a subclass named TheoryCourse that has
Data fields
• profitRate for theory course is 0.4;
Methods:
• constructor ():
adds $30 to the course fee.
• Override the parent class display () method to indicate that the course is a theory course and to display all the data.
• Override the parent class getProfit (): show why?
• The necessary set and get methods
3. Create a subclass named LabCourse that
Data fields:
• profitRate for Lab course is 0.2;
Methods:
• adds $50 to the course fee.
• Override the parent class display () method to indicate that the course is a lab course and to display all the data.
• Override the parent class getProfit (): show why?
• The necessary set and get methods
4. Create a Driver class UseCourse
Write an application named UseCourse and do the following
Data fields:
• Courses: an array of courses:
Methods:
Constructor:
• Initialize the array of courses with capacity = 10 ;
• Creates an array of three TheoryCourse and four LabCourse
• prompts the user for the course type
If the user enters "Theory" as a course type
o TheoryCourse is created
o prompts the user for the course information:
✓ department: any of the following (BIO, CIS, PHY)
✓ course id,
✓ credits
If the user enters "Lab" as course type
o LabCourse is created
o prompts the user for the course information:
✓ department: any of the following (BIO, CIS, PHY)
✓ course id,
✓ credits
PrintOutReport:
write a method PrintOutReport to display the following
o number of Created Courses.
o Total profit, computed as in the following
totalProfit=ΣcourseProfit=0
courseProfit= profitRate * courseFee.
Main method:
Call the constructor of the driver class
call printOutReporty
Then Save the files as FacultyCourse. java,

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 04:30, safi30360oz0c34
What kind of software users of all skill levels create web pages that include graphics, video, audio, animation, and other special effects? website authoring website software website publishing website editing
Answers: 1
image
Computers and Technology, 22.06.2019 21:00, jarrettashlyn
Write a method so that the main() code below can be replaced by the simpler code that calls method original main(): public class calcmiles { public static void main(string [] args) { double milesperhour; double minutestraveled; double hourstraveled; double milestraveled; milesprhour = scnr. nextdouble(); minutestraveled = scnr. nextdouble(); hourstraveled = minutestraveled / 60.0; milestraveled = hourstraveled * milesperhour; system. out. println("miles: " + milestraveled); } }
Answers: 2
image
Computers and Technology, 23.06.2019 14:00, ava5015
What is html ? give a small description about html
Answers: 2
image
Computers and Technology, 23.06.2019 17:00, chrisgaz14
The more powerful, 60 volt cables and the main power shut off on an hev are both colored orange
Answers: 1
Do you know the correct answer?
1. Create a class named FacultyCourse
Data fields:
• department (for example, ENG),

Questions in other subjects:

Konu
Mathematics, 02.10.2021 02:30