COP 3804 Intermediate Java - COP3804pgm4a_6Summer2021 Professor: Michael Robinson e-mail : michael.robinson@cs.fiu.edu - At the beginning of your program add the following: /********************************************************************* Author : Your Name Course : Java section. Example Java-1, Java-2, Java-3, or Java-4 Professor : Michael Robinson Program # : Program Purpose/Description { A brief description of the program } Due Date : MM/DD/YYYY Certification: I hereby certify that this work is my own and none of it is the work of any other person. ..........{ your signature }.......... *********************************************************************/ -------------------------------------------------------------------------------- Worth 12 Points - 2 extra points above the total 100 points - Program must be named: yourLastNameFirstLetterOfYourFirstNamePgm4.java ex: robinsonMpgm4.java - Make sure the program is properly documented and aligned uniformally, according to our "JAVA Programming Rules", discussed in class and located at: http://users.cis.fiu.edu/~mrobi002/includes/JAVA_programmingRules I will take points off if you do not follow the programming instructions. Purpose of this program: ======================== Master the creation and implementation of: 1. Polymorphism begins at page 342 in our book 2. Interfaces begins at page 379 in our book See our book in page 361 for graphical representations, where PolySuper is a super class sub1 extends PolySuper sub2 extends PolySuper sub3 extends PolySuper objectBuilder extends PolySuper, sub1, sub2, sub3 polimorphicArrays extends calling program multiAccess extends calling program --------------------------------------------------------------------- Polymorphism ------------ ------------------------------------ | robinsonMSuperPgm4 super-class | | method1 | | method2 | | method3 | ------------------------------------ ^ ^ ^ ----------------------------------- | sub1 | sub2 | sub3 | | Super1 | Super2 | Supper3 | ----------------------------------- ^ ----------------------- | robinsonMTheBuilder | | sub-class | ----------------------- ^ ----------------------- | robinsonMOverloader | | sub-class | ----------------------- ^ -------------------------- | robinsonMTheDriverPgm4 | | driver-class | -------------------------- 1) Worth 2 points Create a Super Class named lastNameFirstNameInitialSuperPgm4 containing: a) method1 that accepts one int and can not be inherited displaying the the int value received. b) method2 that accepts two strings and displays them, and also displays I am super method2 c) method3 that accepts nothing and displays I am super method3 ------------------------------------ | robinsonMSuperPgm4 super-class | | method1 | | method2 | | method3 | ------------------------------------ 2) Worth 2 points Create three sub classes named sub1, sub2, and sub3 which are sub classes of the Super Class named lastNameFirstNameInitialSuperPgm4, and are also Super Classes themselves, and they inherit all methods from your super class in question 1 ( lastNameFirstNameInitialSuperPgm4 ) ----------------------------------- | sub1 | sub2 | sub3 | | Super1 | Super2 | Supper3 | ----------------------------------- 3) Worth 2 points a) Create a sub class named lastNameFirstInitialTheBuilder, which is a sub class of sub2/Super2 class and displays all methods of the lastNameFirstNameInitialSuperPgm4 super class ONLY plus the words: I am TheBuilder ----------------------- | robinsonMTheBuilder | | sub-class | ----------------------- b) Write a sub-class program called lastNameFirstInitialOverloader containing all inheritable methods from your super class in question 1 ( lastNameFirstNameInitialSuperPgm4 ) overloading method2 by displaying "Hello I am the Overloader" ----------------------- | robinsonMOverloader | | sub-class | ----------------------- 4) Worth 2 points Create a driver class (with a main method) named lastNameFirstNameInitialTheDriverPgm4 (example robinsonMTheDriverPgm4) using all methods in all classes from questions 1, 2 and 3 -------------------------- | robinsonMTheDriverPgm4 | | driver-class | -------------------------- Interfaces ---------- 5) Worth 2 points Create an interface named lastNameFirstNameFirstLetterInterface ex: robinsonMinterface with a) The usual documentation /* Author : Michael Robinson Program : robinsonMinterface.java Purpose : This is an Interface example Due : September 1, 2099 */ b) And the following String global public variables: personPanterID = ""; personLastName = ""; personFirstName = ""; c) And the following method templates returning void and accepting Strings thePersonSchool thePersonID thePersonLastName thePersonFirstName 6) Worth 2 points Create a program that implements the interface in question 5) and name it lastNameFirstNameFirstLetterDriver ex: robinsonMDriver a) Make sure to initialize your global variables. b) Create a new global variable named school, containing the String FIU c) In the thePersonSchool method display the global variable containing FIU d) In the thePersonID method display a String passed in from the main method e) In the thePersonLastName method display your global variable f) In the thePersonFirstName method display a String passed in from the main method