Menu

[solved]-Assume Class Student Implements Speaker Interface Textbook Recall Interface Includes Two A Q39031317

Assume the class Student implements the Speaker interface fromthe textbook. Recall that this interface includes two abstractmethods, speak( ) and announce(String str). A Student contains oneinstance data, String classRank. Write the Student class so that itimplements Speaker as follows. The speak method will output “I am anewbie here” if the Student is a “Freshman”, “I like my school” ifthe Student is either a “Sophomore” or a “Junior”, or “I can notwait to graduate” if the student is a “Senior”. The announce methodwill output “I am a Student, here is what I have to say” followedby the String parameter on a separate line. Finally, the classRankis initialized in the constructor. Only implement the constructorand the methods to implement the Speaker interface.

Expert Answer


Answer to Assume the class Student implements the Speaker interface from the textbook. Recall that this interface includes two abs… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *