Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java Programming JAVA OOP POLYMORPHISM Given Teacher is the superclass, YoungTeacher and SeniorTeacher are the subclasses. Superclass Attributes Methods Subclass Attributes : Teacher :int TeachID;
Java Programming
JAVA OOP POLYMORPHISM Given Teacher is the superclass, YoungTeacher and SeniorTeacher are the subclasses. Superclass Attributes Methods Subclass Attributes : Teacher :int TeachID; //teacher ID String teachName; //teacher name String facName; //faculty name : constructor, mutator, accessor, printer public abstract double calculate Bonus(); YoungTeacher : String mentorName; //mentor's name boolean XKICStud; //true - if the teacher is ex-KIC student int years; llyear of service : constructor, mutator, accessor, printer, abstract method :SeniorTeacher : String dateJoin; //date joining KIC String grade; //JF25, JF32, JF33, JF34 constructor, mutator, accessor, printer, abstract method Methods Subclass Attributes Methods Every year, each teacher will receive a bonus, but at a different rate depending on their status as a young or senior teacher. The bonus for each teacher type is determined using the following table: Teacher type Total bonus (SGD) Year of service 5 years 1600 1900 2100 Young teacher Teacher type Grade JF32 JF33 JF34 Total bonus (SGD) 2300 2400 2600 Senior teacher a) Write a complete class for Teacher, YoungTeacher and SeniorTeacher. b) Write a function named calculateBonus() to calculate and return the bonus paid to each teacher for both subclasses. c) Complete the main application to do the following tasks: i. ii. iii. Count and display the number of young teachers who are ex-KIC students. Calculate and display the total bonus that KIC should pay to all teachers. Display the information of senior teacher whose grade is JF34Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started