Examlex

Solved

Assume the Class Student Implements the Speaker Interface from the Textbook

question 34

Essay

Assume the class Student implements the Speaker interface from the textbook. Recall that this interface includes two abstract methods, speak( ) and announce(String str). A Student contains one instance data, String classRank. Write the Student class so that it implements Speaker as follows. The speak method will output "I am a newbie here" if the Student is a "Freshman", "I hate school" if the Student is either a "Sophomore" or a "Junior", or "I can not wait to graduate" if the student is a "Senior". The announce method will output "I am a Student, here is what I have to say" followed by the String parameter on a separate line. Finally, the classRank is initialized in the constructor. Only implement the constructor and the methods to implement the Speaker interface.


Definitions:

Employment Law

The branch of law that deals with the rights and duties between employers and workers.

Agency Law

A body of law concerned with principal-agent relationships, focusing on the rights and duties that arise when one party acts for or represents another.

Principles

Fundamental truths or propositions that serve as the foundation for a system of belief, behavior, or reasoning.

Agency Law

The legal framework that regulates the relationship between agents who are authorized to act on behalf of principals, and the principals themselves, establishing duties and rights.

Related Questions