* Use System.out.printf ONLY to do all printing *
* No IDEs can be used. All programs MUST be done inTERMINAL MODE using editors *
Purpose of this program: ======================== a) Super Classesb) Sub Classesc) Interfaces
You need to write 6 very small java programs as follows:1) lastNameFirstNameInitialSuperPgm3 2) lastNameFirstNameInitialSubOne 3) lastNameFirstNameInitialSubTwo 4) lastNameFirstNameInitialDriverPgm3 5) lastNameFirstNameInitialinterface 6) lastNameFirstNameInitialinterfaceDriver
Questions:
Super and Sub Classes---------------------1) *** Make sure to write the corresponding valueeverytime you see lastNameFirstNameInitialSuperPgm3 *** Write a super class program calledlastNameFirstNameInitialSuperPgm3 containing: a) methodOne that accepts one int, which cannot be inherited, displaying the theint value received. b) methodTwo that accepts two strings anddisplays I am super methodTwo c) methodThree that accepts nothing and displays I amsuper methodThree
2) *** Make sure to write the corresponding valueeverytime you see lastNameFirstNameInitialSubOne *** Write a sub-class program namedlastNameFirstNameInitialSubOne that inherets all methods from your super class inquestion 1 ( lastNameFirstNameInitialSuperPgm3 ), and also display I am sub-class One.
3) *** Make sure to write the corresponding valueeverytime you see lastNameFirstNameInitialSuperPgm3 *** *** Make sure to write the corresponding valueeverytime you see lastNameFirstNameInitialSubTwo *** Write a sub-class program namedlastNameFirstNameInitialSubTwo containing all inheritable methods from your super class inquestion 1 ( lastNameFirstNameInitialSuperPgm3 ) overriding methodTwo by displaying "I am overridingmethodTwo from lastNameFirstNameInitialSuperPgm3"4) *** Make sure to write the corresponding valueeverytime you see lastNameFirstNameInitialDriverPgm3 *** Write a DRIVER class (with a main method) namedlastNameFirstNameInitialDriverPgm3 using all methods in all classes from questions 1, 2and 3
Interfaces---------- 5) *** Make sure to write the corresponding valueeverytime you see lastNameFirstNameInitialinterface *** Create an interface namedlastNameFirstNameInitialinterface with a) The following String global public variables: personPanterID = ""; personLastName = ""; personFirstName = "";
b) And the following method templates returningvoid and each method accepting one String thePersonSchool thePersonPantherID thePersonLastName thePersonFirstName
6) *** Make sure to write the corresponding valueeverytime you see lastNameFirstNameInitialinterfaceDriver *** Create a program that implements the interface inquestion 5) and name it lastNameFirstNameInitialinterfaceDriver a) Make sure to initialize your global variables,example: personPanterID = "any number"; personLastName = "DELGADO"; personFirstName = "MANUEL"; b) Create a new global variable named school,containing the String FIU c) In the thePersonSchool method display the newglobal variable containing FIU d) In the thePersonPantherID method display thecorresponding global variable passed in from the mainmethod e) In the thePersonLastName method display thecorresponding global variable passed in from the main method f) In the thePersonFirstName method display thecorresponding global variable passed in from the main method
* Use System.out.printf ONLY to do all printing * * No IDEs can be used. All programs MUST be done in TERMINAL MODE u
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am