Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Java How To Program Late Objects Version

Authors: Paul Deitel, Deitel & Associates

8th Edition

0136123716, 9780136123712

More Books

Students also viewed these Programming questions

Question

In Exercises 32-37, find the values of x and y. 43 75

Answered: 1 week ago