Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need to create a test app for the following program that also creates two Employee objects and displays each objects yearly salary, then gives

I need to create a test app for the following program that also creates two Employee objects and displays each objects yearly salary, then gives each Employee a 10% raise and display each Employees yearly salary again.

public class Employee { //Declare instance variables private String lastName, firstName; private double monthlySalary; //Include constructor public Employee(String lastName, String firstName, double monthlySalary, String theLastName, String theFirstName, double theMonthlySalary){ theLastName = lastName; theFirstName = firstName; theMonthlySalary = monthlySalary; } //Provide get method for name and salary public String getFirstName() { return firstName; }

public String getLastName() { return lastName; }

public double getMonthlySalary() { return monthlySalary; }

//Provide set method for name and salary public void setFirstName(String s) { firstName = s; }

public void setLastName(String s){ lastName = s; }

public void setMonthlySalary(double v){ if (v<=0) { monthlySalary = v; } }

//Display information to user public void display() { System.out.printf("First name: %s ", getFirstName()); System.out.printf("Last name: %s ", getLastName()); System.out.printf("Monthly salary: %.2f ", getMonthlySalary()); System.out.printf("Yearly Salary: %.2f ", 12.0 * getMonthlySalary());

System.out.println(); } }

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

MFDBS 91 3rd Symposium On Mathematical Fundamentals Of Database And Knowledge Base Systems Rostock Germany May 6 9 1991

Authors: Bernhard Thalheim ,Janos Demetrovics ,Hans-Detlef Gerhardt

1991st Edition

3540540091, 978-3540540090

More Books

Students also viewed these Databases questions

Question

Explain strong and weak atoms with examples.

Answered: 1 week ago

Question

Explain the alkaline nature of aqueous solution of making soda.

Answered: 1 week ago

Question

Comment on the pH value of lattice solutions of salts.

Answered: 1 week ago