Question: Code should make with java. Imrwh ITI C Get Homework Hep With Chege x + office365-14d-prodinstructure.com/u/like-share-item/231471/10_content_item_selection Lab 5 Inheritance, Interfaces, and Abstract Classes Lab Objectives





Code should make with java.
Imrwh ITI C Get Homework Hep With Chege x + office365-14d-prodinstructure.com/u/like-share-item/231471/10_content_item_selection Lab 5 Inheritance, Interfaces, and Abstract Classes Lab Objectives Understand and use the coecept of inheritance Be able to explain the difference between an interface and an abstract class Implant an existing interface Create and use womeration Task #1 Abstract Class 1. Create a local repository hooked up to your empty git repository for the course 2. Create a project and Labs and connect it to the local repository. 3. Createm abstract class exted Stout Person hy a In the package explorer window, right click on project name and select New, Class b. Ente package man, dass name and check abstract, where dick Finish BE c. Add the following private instance raiables: i.is ii. String Name iii. String firstName d. Create the constructor with all instance viables as parameters 1. Click on Source Generate Constructor using Fields of use Alt-Shift+ (tap) S. tap) ii. Select all fields. Check Generate Constructor Comments and Omit call to . default constructor supero. Click Generate. ENGE 15 1000 Imrwh ITI C Get Homework Hep With Chege x + A office365-jad-prodinstructure.com/16/inkel-share-item/231471/10_content_item_selection e. Add the getter and setter methods On the menu select Source, Generate Getters and Setters or use Alt-Shift + (tap) 5. (tap) R. Select all, but expand the id field and undbeck setidint). Check Generate method comments Click Gencate f. Tinish the generated Javadoc comments for the class and methods. . Create an abstract method in the class i public abstract String role). h. Save the file for changes to take effect ENGE 2 Ors 2 1000 Imrwh ITI C Get Homework Hep With Chege x + A office365-jad-prodinstructure.com/16/inkel-share-item/231471/10e_content_item_selection Task #2 Child Class 1. In the package exploat window.right-dick a project me and create a new dass Stout Student . In the Superclass box, enter Stout Person and click Browse. You should be able to select the correct file Check Constructors from superdess, Thenited abstract methods and Generate comments b. Create an enumeration for Level that allows fresh, sophomore, junior, and senice as the only possible values. c Add instance variables i. Level year ii. Sering major d. Use Eclipse lo automatically cute geile indslas e Use Eclipse to automatically create a constructor with all fields. Notice there are two constructors now. One that takes in the 3 parameters from the super class and cue that takes in all parameters. Also notice that both call the super constructor ind pass in the informatice to be stored in the variables inherited from the super class. Finish off the constractor that takes 3 parameters by initializing the year to be Level.fresh and initializing the major to be "Undedared f. Implement role to return the string takes classes 2. Create the class Storat Faculty in the same way that you created StatStudent a. It must extend Stout Pesce b. Add the instance variable i. Sering position c. Create the constructor (all parameters), etter and setter methods. Initialize the position to "Instructor in the constructor that does not have a parameter for position d. Implement the method role to return the String teaches students". 3. Override toString method in each class by implementing it in cach class a. You must call super.toString to print out information from your parest claes. DO NOT USE GET METIIODS TO GET VARIABLES FROM YOUR PARENT CLASST Use the variable in its own class only Task #3 Testing ANGESOS 14 Imrwh ITI C Get Homework Hep With Chege x + A office365-jad-prodinstructure.com/16/inkel-share-item/231471/10_content_item_selection 1 Create a new class called Stout Teater that includes amen method a Create an array of size and type Stout Person b. Create objects (type Stout Faculty with fields listed below) to put in the array i. Scott, Turner, Associate Professe, 1256 ii. Diane Christie, Professor, 615 iii. Terry Masom Professor 1073 c. Put into the way a Stout Student, using your info. Pat other Stout Studentinto the ray, but only pass in theid, first and last name so that the student will be am undeclared fresh by using the constructor with sily three parandas. d. Use a for loop and a single print statement to print the toString information and roles. e At this point it should print something like this Turner, COLE ID: 1256 Associate Professor teaches students Christie, Dlang ID: 615 Prufur teaches students Mason, Terry ID: 1073 Professor teaches students Seth, John D: 4530 Undeclared freshe takes classes Dee, San ID: 1714 Computer Science sophomore takes classes Task #4 Grandchildren! 1. Create the class Slout Sl that extends Stout Student a. Add field String course. b. Add constructor and mutator methods. c. Override role to call the parent class role and add to that result the string and teaches students d. Oreide to String as above 2. In the music of Stcut Tester, change the size of the way to six. Add a SI object for Andrew Nelson co Nicholas Xiong to StoutPeson stay. The major would be computer Scimo, level is junior, and the course would be CS-145. You can make ap an id. Task #5 Implement an Interface 1. In the Stout Person class, implement the Comparable interface using the Stout Person as the template type. In your definition of the compare lo method, use the lastName to compare Stout Persom abjects Hint Since last Name is a String you can call the commeT method of the String class to do the comparison 2. In the main of Stout Tester, add a line to use Anys.sex to set the objects in the ray by lastName. You output should look something like this when you are finished ANGOR 14 Lunch ITI Get Homewn Hep With Chege x + A office365-jad-prodinstructure.com/16/inkel-share-item/231471/10_content_item_selection ID: 15 Professor teaches students " ID: 1234 Computer Science sophomore takes classes Mason, Terry ID: 1073 Professor rather stuente Nelson, Andrew : Computer Science Junior takes classes and tenches students C5-145 Saith, Joan 10: 4520 Uradeclared frwan teks class Turner, Scott 10: 3256 Associate Professor teaches students ASSO 1000 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
