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:

Operations

The day-to-day activities involved in running a business, such as production, purchasing, and distribution, aimed at generating profits.

Cash Paid

The actual outflow of cash or cash equivalents as payment for goods, services, or financial obligations.

Wages and Salaries

Payments made to employees in exchange for their labor or services, categorized as either hourly (wages) or fixed annual amounts (salaries).

Cash and Cash Equivalents

Liquid assets that include currency, checks, and short-term investments that can be quickly converted to cash.

Related Questions