Write a program using the concept of interface to do the following. a) Create an interface Student with a method calculateBonus(double) which calculates Bonus of a Student b) Inherit the interface Student into a subclass Worker Bonus. In WorkerBonus class do the following tasks: ) Create a method getStudentDetails() to read id, name and cgpa of an Student. ii) Inside the calculateBonus() method calculate the Bonus using the following conditions. cgpa Bonus >=4 10% >=3 5% >=2 3% <2 2% iii) Create a method netcgpa() in the subclass to print the cgpa. Note: cgpa=cgpa+Bonus
Write a program using the concept of interface to do the following. a) Create an interface Student with a method calculateBonus(double) which calculates Bonus of a Student b) Inherit the interface Student into a subclass Worker Bonus. In WorkerBonus class do the following tasks: ) Create a method getStudentDetails() to read id, name and cgpa of an Student. ii) Inside the calculateBonus() method calculate the Bonus using the following conditions. cgpa Bonus >=4 10% >=3 5% >=2 3% <2 2% iii) Create a method netcgpa() in the subclass to print the cgpa. Note: cgpa=cgpa+Bonus
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 12PE
Related questions
Question
Java
![Write a program using the concept of interface to do the following.
a) Create an interface Student with a method calculateBonus(double) which calculates Bonus of a Student
b) Inherit the interface Student into a subclass Worker Bonus. In WorkerBonus class do the following tasks:
) Create a method getStudentDetails() to read id, name and cgpa of an Student.
ii) Inside the calculateBonus() method calculate the Bonus using the following conditions.
cgpa
Bonus
>=4
10%
>=3
5%
|>=2
3%
<2
2%
iii) Create a method netcgpa() in the subclass to print the cgpa.
Note: cgpa=cgpa+Bonus](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F689042e4-7c46-47aa-abac-37774cf21268%2Fd009e685-87d4-4c86-8631-a2eae850d982%2F6fz1p5i_processed.png&w=3840&q=75)
Transcribed Image Text:Write a program using the concept of interface to do the following.
a) Create an interface Student with a method calculateBonus(double) which calculates Bonus of a Student
b) Inherit the interface Student into a subclass Worker Bonus. In WorkerBonus class do the following tasks:
) Create a method getStudentDetails() to read id, name and cgpa of an Student.
ii) Inside the calculateBonus() method calculate the Bonus using the following conditions.
cgpa
Bonus
>=4
10%
>=3
5%
|>=2
3%
<2
2%
iii) Create a method netcgpa() in the subclass to print the cgpa.
Note: cgpa=cgpa+Bonus
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
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.Recommended textbooks for you
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,