subject

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, TheoryCourse. java LabCourse. java, and UseCourse. java.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 23:00
The animal classthis class represents a an animal residing at a zoo. it has a weight (in pounds),height (in inches), a name, and a color. the methods in the class include constructors,getters, and a tostring. you will finish the implementation of these methods. referto the code documentation.1.getters: you will need to implement getter methods. these get a value (froma member variable) in the animal class. you will make a getter method toreturn each variable (weight, height, name, color). reference getname if youare having issues.2.tostring: you will need to finish the tostring method. this returns a stringcontaining information about an animal. the output string should be of theformat: ” (name) , a ( color )â’colored animal . ( weight ) pounds , ( height ) inches .\n”the height and weight are formatted to 1 decimal place. recall from lab 1how to format strings neatly using string. see the reference sectionfor more about string.format.
Answers: 2
question
Computers and Technology, 22.06.2019 11:00
The editing of digital photos us about the same level of difficulty as editing an analog photo
Answers: 2
question
Computers and Technology, 23.06.2019 06:30
You are consulting for a beverage distributor who is interested in determining the benefits it could achieve from implementing new information systems. what will you advise as the first step?
Answers: 1
question
Computers and Technology, 23.06.2019 17:30
Per the municipal solid waste report, what are the most common sources of waste (trash
Answers: 3
You know the right answer?
1. Create a class named FacultyCourse
Data fields:
• department (for example, ENG),
Questions
question
English, 22.06.2019 08:40
question
Mathematics, 22.06.2019 08:40
Questions on the website: 13722360