Tested on Eclipse Both class should be in same package /***********UNMember class***********/ import java.util.Scanner; public class UNMember { /*data member declaration*/ private String name; private int NUID; private String netID; private String collegeLocation; Scanner input=new Scanner(System.in); /*Default constructor*/ public UNMember() { } /*Parameterized constructor*/ public UNMember(String name, int nUID, String netID) { setName(name); setNUID(nUID); setNetID(netID); setCollegeLocation(); } /*Getter and setter method of data member variable*/ public String getName() { return name; } public void setName(String name) { this.name = name; } public int getNUID() { return NUID; } public void setNUID(int nUID) { NUID = nUID; } public String getNetID() { return netID; } public void setNetID(String netID) { this.netID = netID; } public String getCollegeLocation() { return collegeLocation; } public void setCollegeLocation() { String collegeLocation; /*Prompt for college location*/ System.out.println(\"Please Enter the college Location\"); collegeLocation=input.nextLine(); this.collegeLocation = collegeLocation; } @Override public String toString() { return \"Name:\" + name.toUpperCase() + \"\ NUID=\" + NUID + \"\ NetID:\" + netID.toUpperCase() + \"\ Campus Location:\" + collegeLocation.toUpperCase() + \"\ \"; } } /************UNStaff class*************/ import java.text.DecimalFormat; public class UNStaff extends UNMember{ /*Member data variable declaration*/ private String position; private double wage; /*Parameterized constructor*/ public UNStaff(String position, double wage,String name,int NUID,String netID) { super(name,NUID,netID); setPosition(position); setWage(wage); } /*Getter and Setter method of data member variable*/ public String getPosition() { return position; } public void setPosition(String position) { if(position.equals(\"\")|| position==null){ this.position=\"NOT SET\"; }else{ this.position = position; } } public double getWage() { return wage; } /*Set wage , if wage less then 9 then we are setting it to -1*/ public void setWage(double wage) { if(wage<9){ this.wage=-1; }else{ this.wage = wage; } } /*ToString method*/ @Override public String toString() { String result=\"Position:\" + position.toUpperCase() + \"\ \"; if(this.wage==-1){ result+=\"Wage:NOT SET\"; }else{ result+=\"Wage:$\"+new DecimalFormat(\"##.00\").format(this.wage); } return super.toString()+result; } public static void main(String args[]){ UNStaff staff=new UNStaff(\"secretary\", 50.6, \"David\", 123, \"UN123\"); UNStaff staff1=new UNStaff(\"cleark\", 8, \"Sam\", 129, \"UN129\"); System.out.println(\"**************\"); System.out.println(staff.toString()); System.out.println(\"**************\"); System.out.println(staff1.toString()); } } /***************output*************/ Please Enter the college Location california Please Enter the college Location Los Angeles ************** Name:DAVID NUID=123 NetID:UN123 Campus Location:CALIFORNIA Position:SECRETARY Wage.