Question: Construct a interface ID with the methods: setID(String strID); getID(); boolean validateID(String strID); //Verifies id ID is valid Desing abstract class human with attributes name



Construct a interface ID with the methods:

setID(String strID);

getID();

boolean validateID(String strID); //Verifies id ID is valid


Desing abstract class human with attributes name , weight and age. The constructor will assign values with to this attributes. Also will have sets and gets. Also it have the abstract method talk() which don't receive any arguments or return value. Also a method toString will return the values of the attributes.


Construct abstract class IDCard which implements interface ID. The class will have String cardID. The constructor will allow to assign values with to this attributes


Construct the class Student who inheritance human class and implements interface ID. Will have 2 attribute String mayor, StudentID. Also the Attribute studentDebitCard from the class IDCard. The constructor will receive name, mayor, StudentID,weight and age. In the constructor the object StudentDebitCard will be created with an Empty String ID . The class will implements setStudentDebitCardID() and getStudentDebitCardID() to set and obtain studentdebitcard. The class will also implements the method talk() wich is inheritance from human and print the string on screen. Also the method tostring will print


Finally, construct a main which will create the object student and demonstrate all the classes and interfaces work.




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!