Create class Employee. • Use static variable an nualTaxRate to store the annual tax rate for all employees. Also use anothe static variable infl ationRate [0-1]. Use inline initi aliz ation for inflationRate = 0.3, whereas annualTaxRate is initi aliz edu sin g the following rule in a staticinit block. • If inflationRate is higher than 0.5, then annual Tax Rate is 5%, else annu al TaxRate is 10%. • Each object of the Employee class contains private in stancevari ables n ame andsalary indicating the employ ee n ame an dmon thly salary of the employee. • Provide constructor(s) and getter/sett er methods. The con str uctor and getter/setter methoc should use shadow ing parameters names. (hint: use 'this’). Add also a con structor that takes object as paramet er. • Provide methodcompute Annual Tax to calculate the monthly interest by multiplying the Annual salary by annu al TaxRate divided by 100 – this tax should be returnedfrom computeAnnualTax. Write class EmpTest for testingthe Employee class • Create an employee object emp1bycalling constructorswith appropriate values(salan = 20000). • Create anotheremployee object emp2having default salary (say 30000) • Create thi rd employee emp3 having the values same as emp2. • Inputsalary from userand update the salary of emp2 to the newsalary (say 50000). • Compute Annual tax for all the employees and display them in the test class. • Compare the salaries of each employee toshow the employee with the highest monthly salary. *Upd ate the employee class so that it contains another instance variable called netMonthly Income, which defined as monthly salary minus(-) monthly income tax. Add a method to the class Employee cale computeNetS alary to compute it.
Create class Employee. • Use static variable an nualTaxRate to store the annual tax rate for all employees. Also use anothe static variable infl ationRate [0-1]. Use inline initi aliz ation for inflationRate = 0.3, whereas annualTaxRate is initi aliz edu sin g the following rule in a staticinit block. • If inflationRate is higher than 0.5, then annual Tax Rate is 5%, else annu al TaxRate is 10%. • Each object of the Employee class contains private in stancevari ables n ame andsalary indicating the employ ee n ame an dmon thly salary of the employee. • Provide constructor(s) and getter/sett er methods. The con str uctor and getter/setter methoc should use shadow ing parameters names. (hint: use 'this’). Add also a con structor that takes object as paramet er. • Provide methodcompute Annual Tax to calculate the monthly interest by multiplying the Annual salary by annu al TaxRate divided by 100 – this tax should be returnedfrom computeAnnualTax. Write class EmpTest for testingthe Employee class • Create an employee object emp1bycalling constructorswith appropriate values(salan = 20000). • Create anotheremployee object emp2having default salary (say 30000) • Create thi rd employee emp3 having the values same as emp2. • Inputsalary from userand update the salary of emp2 to the newsalary (say 50000). • Compute Annual tax for all the employees and display them in the test class. • Compare the salaries of each employee toshow the employee with the highest monthly salary. *Upd ate the employee class so that it contains another instance variable called netMonthly Income, which defined as monthly salary minus(-) monthly income tax. Add a method to the class Employee cale computeNetS alary to compute it.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Using JAVA
Topic: Passing Objects and Returning Objects
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
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
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education