Question
Java coding..... Create an abstract class Teacher. Your Teacher class should include the following attributes: First name (string) Last name (string) Teacher id (string) Teacher
Java coding.....
Create an abstract class Teacher. Your Teacher class should include the following attributes: First name (string) Last name (string) Teacher id (string) Teacher home street address (string) Teacher home city (string) Teacher home state (string) Write a constructor to initialize the above Teacher attributes. Create an abstract method called earnings. Create another class TempTeacher that inherits from the abstract Teacher class. TempTeacher must use the inherited parent class variables and add in attributes TempRate and HoursWorked. Your TempTeacher class should contain a constructor that calls the constructor from the Teacher class to initialize the common instance variables but also initializes the TempRate and HoursWorked. Implement the Teacher abstract earnings method in TempTeacher to calculate the earnings for a week. Note that earnings is Temp rate * hours worked. Create a test class that prompts the user for the information for two TempTeachers, creates the 2 two Temp Teachers objects, calls the earnings method then displays the attributes and earnings for each of the two Temp.
Step 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