Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Anyone please answer this question but not in full code....just answer following the question???? This is java questions Computer Science CONFIDENTIAL 5 CS/FEB 2021/CSC186 QUESTION

image text in transcribed

image text in transcribed

Anyone please answer this question but not in full code....just answer following the question????

This is java questions

Computer Science

CONFIDENTIAL 5 CS/FEB 2021/CSC186 QUESTION 3 One IT Solution Sdn Bhd is a software house company. They are planning to provide a system to store data about teachers. Given are School Teacher and Kindergarten Teacher subclasses which are inherited from Teacher superclass. Superclass: Teacher Attributes: String name; String icNo; String subjectTaught; // identification card no // English, Math, History // year of service int yos; Methods: normal constructor accessor methods toString() abstract double calcSalary() Subclass: School Teacher Attributes: String grade; //teacher grade, e.g: DG41, DG44, DG48 Methods: normal constructor accessor method toString() double calcSalary() Subclass: Kindergarten Teacher Attributes: int otHours; llovertime hours per month Methods: normal constructor accessor method toString() double calcSalary() CONFIDENTIAL 6 CS/FEB 2021/CSC186 a) Write the normal constructor for subclass SchoolTeacher. (2 marks) b) Write the definition of method calcSalary() for both subclasses that calculate and return the teacher's salary based on the following information. i. The salary of school teacher is calculated based on the grade as shown in Table 1: Table 1 : School Teacher Salary Grade Salary (RM) DG41 2000 DG44 3400 DG48 5000 DG52 5600 ii. For kindergarten teachers, the salary is calculated based on the year of service as shown in Table 2 and overtime hours. Table 2: Kindergarten Teacher Salary Year of Service Basic salary (RM) 5 2100 Each overtime hour will be paid RM15. Salary for the kindergarten teachers is the total of basic salary and overtime hours pay. (6.5 marks) c) Based on the classes given, write Java statements to do the following: i. Declare an array of 20 Teacher objects named teach. (1 mark) ii. Display the information of English teachers who have been teaching for more than 10 years. (3 marks) iii. Display the name and salary of school teachers whose grade is DG44. (3.5 marks) iv. Calculate and display the total overtime hours done by the teachers. (4 marks)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions