Question: program to do the following.... the class. Create superclass UTAPerson with String name and String ID. This class has an instance method WhoAmI ( )

 program to do the following.... the class. Create superclass UTAPerson withString name and String ID. This class has an instance method WhoAmI( ) that prints "I am xxxxx" where xxxxx is the name

program to do the following.... the class. Create superclass UTAPerson with String name and String ID. This class has an instance method WhoAmI ( ) that prints "I am xxxxx" where xxxxx is the name of Using UTAPerson, create subclass Student and subclass Employee. In main ( ) , instantiate a Student object and an Employee object and store them in the same ArrayList. Loop over the ArrayList and call WhoAmI () for each element. The output should be I am Student I am Employee Use these lines of code to form your answer. Add { } as needed and format as needed to follow the code formatting standard of this class. Use Preformatted font or lose 5 points. public class Student implements UTAPerson super (name ) ; ABC . add ( Student ( "Student") ) ; name = className ; private void WhoAmI( ) super ( ) ; public UTAPerson ( String className) ArrayList ABC = new ArrayList( ) ; Employee . WhoAmI ( ) ; public Student (String name) public UTAPerson (string className )import util . ArrayList; public Student (string name) ABC . add ( new Employee ( "Employee" ) ) ; className = name; ABC . add ( new Employee ) ; it . WhoAmI ( ) ; this . name = name ; System . out . printf ("I am $s\ ", name) ; public void WhoAmI (name ) System . out . printf ("I am $s\ ", className) ; ABC . add ( new Student ( "Student" ) ) ; for (UTAPerson it : ABC) ABC . add ( new Student) ; import java. util . ArrayList; ABC . add ( new Student ( ) ) ; package feq3; ABC . add ( Employee ( " Employee" ) ) ; public class FEQ3 private string name; UTAPerson . WhoAmI ( ) ; public String ID; public void main (String [ ] args)public void main (String[ ] args) name = this . name ; import java . ArrayList; public string ID; public class Student extends UTAPerson ArrayList ABC = new ArrayList( ) ; public class Employee implements UTAPerson ABC . add ( new Employee ( ) ) ; ArrayList ABC = new ArrayList( ) ; public Employee (string name) private String name; K public static void main ( String [ ] args) public Employee ( String name) Student . WhoAmI ( ) ; for (Student it : ABC) public void WhoAmI ( ) for ( Employee it : ABC) public class Employee extends UTAPerson public class UTAPerson You may need to use a given line of code more than once and some lines are incorrect. DO NOT add new lines or alter the existing lines

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!