Question: JAVA PROGRAMMING Exercise 1: Employees salary Create a class called Employee that includes three pieces of information as instance variablesa first name (typeString), a last

JAVA PROGRAMMING

Exercise 1: Employees salary Create a class called Employee that includes three pieces of information as instance variablesa first name (typeString), a last name (typeString) and a monthly salary (double). Your class should have a constructor that initializes the three instance variables. Provide a set and a get method for each instance variable. If the monthly salary is not positive, set it to 0.0. Write a test application named EmployeeTest that demonstrates class Employees capabilities. Create two Employee objects and display each objects yearly salary. Then give each Employee a 10% raise and display each Employees yearly salary again.

Exercise 2: Stores Invoice Create a class called Invoice that a hardware store might use to represent an invoice for an item sold at the store. An Invoice should include four pieces of information as instance variablesa part number (type String), part description (type String), a quantity of the item being purchased (type int) and a price per item (double). Your class should have a constructor that initializes the four instance variables. Provide a set and a get method for each instance variable. In addition, provide a method named getInvoiceAmount() that calculates the invoice amount (i.e., multiplies the quantity by the price per item), then returns the amount as a double value. If the quantity is not positive, it should be set to 0. If the price per item is not positive, it should be set to 0.0. Write a test application named InvoiceTest that demonstrates class Invoices capabilities.

Exercise 3: Technician and Employee In a company, an employee has: The following members: Name, Age, Salary. The following Constructors: - by default, - with three parameters The following methods: - increase(...); - display() ; - calculatesSalary() ; A technician is additionally described by the attribute: grade and the method bonus( ) and the redefinition of the method calculatesSalary(). - If grade=1 then Bonus= 100 - If grade=2 then Bonus= 200 - If grade=3 then Bonus= 300 Work to do: 1. Write the class Employee. 2. Write the Technician class. 3. Write a program that enters an employee and then a technician and displays their information before and after their salary increase.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!