Question: Create a class called HighSchoolStaff that does the following: 1) Inherits from the base class below 2) Each instance of HighSchoolStaff should have a String
Create a class called HighSchoolStaff that does the following:
1) Inherits from the base class below
2) Each instance of HighSchoolStaff should have a String departmentName
3) Create the appropriate setter and getter methods for departmentName
a) There are no special requirements for verifying the data, so just assume the user will enter valid data
4) Override the setSchoolid method to store the Schoolid in all capital letters
a) There are no special requirements for verifying the data, so just assume the user will enter only letters and numbers
5) Override the toString method to print the last name, first name, Schoolid, and department onto one line like this:
FIRSTNAME LASTNAME works for the DEPARTMENTNAME and the Schoolid is SCHOOLID
Where the bold/italicized text is replaced with the values of the instance variables
public class HighSchoolStaff {
private String lastName;
private String firstName;
private String Schoolid;
public HighSchoolStaff () {
this.lastName = " ";
this.firstName = " ";
this.Schoolid = " ";
}// end of no argument constructor
public HighSchoolStaff(String lastName, String firstName, String Schoolid) {
this.lastName = lastName;
this.firstName = firstName;
this.Schoolid = Schoolid;
}// end of constructor with 3 arguments
public String getLastName() {
return lastName;
}// end of getLastName()
public String getFirstName() {
return firstName;
}// end of getFirstName()
public String getSchoolid() {
return Schoolid;
}// end of getSchoolid()
public void setLastName (String lastName) {
this.lastName = lastName;
}// end of setLastName (String lastName)
public void setFirstName (String firstName) {
this.firstName = firstName;
}// end of setFirstName (String firstName)
public void setSchoolid (String Schoolid) {
this.Schoolid = Schoolid;
}// end of setSchoolid (String Schoolid)
}// end of HighSchoolStaff
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
