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...


Now write a test program that performs the following tasks:<br>1. Create a Faculty object with an id of 1001, name as Gareth Bale, age of 43<br>years, initial as GB, the monthly salary of 30000 BDT, the yearly bonus of 40000<br>BDT.<br>2. Call the toString() method of the Faculty class where yearlySalary,yearlylncome,<br>yearlylncome Tax, yearlylncomeWithout Tax are included.<br>In console:<br>Faculty [initial=GB, monthlySalary=30000, yearlyBonus=40000, yearlySalary=360000,<br>yearlylncome=400000, yearlylncomeTax=60000.0, yearlylncomeWithoutTax=340000.0]<br>3. Now modify the Faculty class in such a way so that objects can't be created with<br>a negative yearly bonus. If any Faculty object is created with a negative yearly<br>bonus, it'll throw an exception such as IllegalArgumentException with an<br>appropriate error message like

Extracted text: 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 BDT. 2. Call the toString() method of the Faculty class where yearlySalary,yearlylncome, yearlylncome Tax, yearlylncomeWithout Tax are included. In console: Faculty [initial=GB, monthlySalary=30000, yearlyBonus=40000, yearlySalary=360000, yearlylncome=400000, yearlylncomeTax=60000.0, yearlylncomeWithoutTax=340000.0] 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. 5. Then catch with an appropriate error message, if any exception occurs here.
Implement the following UML class diagrams which include an abstract class<br>Employee, an interface TaxCalculator, and a child class Faculty.<br>Employee<br><cinterface>> TaxCalculator<br>+TAX_PERCENT: int = 15<br>- id : int<br>- name : String<br>age : int<br>+ yoarlylncome Tax( : double<br>+ yeariylncomeWithouRTax() ; double<br>Employee (id : int, name : String, age<br>: int)<br>+ Getters<br>+ Setters<br>+ yearlySalary() : int Wabstract<br>+ yearlyincome) : int Mabstract<br>Faculty<br>- initial : String<br>monthlySalary : int<br>- yearlyBonus : int<br>• Faculty (id: int, name : String, age : int,<br>initial : String, monthilySalary : int,<br>yearlyBonus : int)<br>+ Getters<br>+ Setters<br>+ toString0 : String<br>

Extracted text: Implement the following UML class diagrams which include an abstract class Employee, an interface TaxCalculator, and a child class Faculty. Employee > TaxCalculator +TAX_PERCENT: int = 15 - id : int - name : String age : int + yoarlylncome Tax( : double + yeariylncomeWithouRTax() ; double Employee (id : int, name : String, age : int) + Getters + Setters + yearlySalary() : int Wabstract + yearlyincome) : int Mabstract Faculty - initial : String monthlySalary : int - yearlyBonus : int • Faculty (id: int, name : String, age : int, initial : String, monthilySalary : int, yearlyBonus : int) + Getters + Setters + toString0 : String
Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here