Assume the class Student implements the Speaker interface from the textbook. Recall that this interface includes two abstract methods, speak() and 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 like my 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.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter10: Introduction To Inheritance
Section: Chapter Questions
Problem 20RQ
icon
Related questions
Question
Solve in Java only provide the Code to implement the constructor and the methods to implement the speaker interface
Assume the class Student implements the Speaker interface from the textbook. Recall that this interface includes two abstract methods, speak() and
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 like my 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.
Edit Format Table
12pt v Paragraph
BI
UA 2
T²
P 4
E✓ ✓
To
EB
√x
Transcribed Image Text:Assume the class Student implements the Speaker interface from the textbook. Recall that this interface includes two abstract methods, speak() and 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 like my 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. Edit Format Table 12pt v Paragraph BI UA 2 T² P 4 E✓ ✓ To EB √x
Expert Solution
steps

Step by step

Solved in 5 steps with 1 images

Blurred answer
Knowledge Booster
Developing computer interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT