Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3.1 Implement a class Employee. An employee has a name (a string) and a salary (a double). Provide a constructor with two parameters public Employee(String

3.1 Implement a class Employee. An employee has a name (a string) and a salary (a double). Provide a constructor with two parameters

public Employee(String employeeName, double currentSalary) and methods public String getName()

public double getSalary()

public void raiseSalary(double byPercent)

These methods return the name and salary, and raise the employee's salary by a certain percentage. Sample usage:

Employee harry = new Employee("Hacker, Harry", 50000); harry.raiseSalary(5); // Harry gets a 5% raise

3.2 Supply an EmployeeTester class and test the Employee class as follows. Declare an Employee object for Smith, John with salary of $75406.25.

Print out the name and salary of this employee.

Ask user how much percentage should the employees salary to be raised? Input 2.5 for 2.5% raise.

Print out the name and salary of this employee. You should use formatted print and round the salary to the nearest cent.

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_2

Step: 3

blur-text-image_3

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

Learning PostgreSQL

Authors: Salahaldin Juba, Achim Vannahme, Andrey Volkov

1st Edition

178398919X, 9781783989195

More Books

Students also viewed these Databases questions

Question

What are Electrophoresis?

Answered: 1 week ago

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago