Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instructions: You must upload the java file(s) as an assignment submission in Canvas Late submission will not be allowed. The solution that you submit must

image text in transcribed

Instructions: You must upload the java file(s) as an assignment submission in Canvas Late submission will not be allowed. The solution that you submit must be your own work. . Plagiarism will lead to a straight zero. Now write a test program that performs the following tasks: 1. Create a Faculty object with an id of 1001, name as Gareth Bale, age of 43 years, initial as GB, the monthly salary of 30000 BDT, the yearly bonus of 40000 Question 01: Implement the following UML class diagrams which include an abstract class Employee , an interface TaxCalculator, and a child class Faculty. BDT 2. Call the toString() method of the Faculty class where yearly Salary yearlylncome, yearlylncome Tax, yearlylncome Without Tax are included. Employee dint -name: String -ageint > TaxCalculator + TAX_PERCENT: 10:15 + yearlylncome Tax(): double + yearlyIncomeWithout Tax): double In console: Faculty (initial=GB, monthly Salary=30000, yearlyBonus = 40000, yearly Salary=360000, yearlylncome=400000, yearlylncome Tax=60000.0, yearlylncome Without Tax=340000.0] Employee (d: int name: Sring age int) +Geters + Setters + yearly Salary: int l'abstract + yearlylcome); int fabstract 3. Now modify the Faculty class in such a way so that objects can't be created with a negative yearly bonus. If any Faculty object is created with a negative yearly bonus, it'll throw an exception such as IllegalArgumentException with an appropriate error message like "Yearly bonus can't be negative" 4. Create another Faculty object with an id of 1002, name as lan Goodfellow, age of 46 years, initial as IGF, the monthly salary of 30000 BDT, the yearly bonus of - 40000 BDT Faculty intial: String monthly Salary: it yearlyBonus:int - Faculy (id:int, name: String, ageint intal String, monthly Salary: Int. yearlyBonus:int) Getters + Setters String String + 5. Then catch with an appropriate error message, if any exception occurs here

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions

Question

11. Contrast organization strategy and operations strategy.

Answered: 1 week ago

Question

=+ d. What happens to Oceanias trade balance?

Answered: 1 week ago