Question: class Main{ public static void main(String[]args){ //instance 1 Employee e = new Employee(Fred Flinstone,35000.00,181,Crane Operator); System.out.println(e);//print out e.setName(Fred Flinstone); e.setSalary(41000); e.setMonths(181); e.setJobType(Superviser); System.out.println(e); e.increaseSalary(.05); System.out.println(e);

class Main{

public static void main(String[]args){

//instance 1

Employee e = new Employee("Fred Flinstone",35000.00,181,"Crane Operator");

System.out.println(e);//print out

e.setName("Fred Flinstone");

e.setSalary(41000);

e.setMonths(181);

e.setJobType("Superviser");

System.out.println(e);

e.increaseSalary(.05);

System.out.println(e);

//instance 2

e = new Employee("Barney Rubble",30000.00,101,"Driver");

System.out.println(e);//print out

e.setName("Barney T. Rubble");

e.setSalary(32000);

e.setMonths(91);

e.setJobType("Janitor");

System.out.println(e);

e.decreaseSalary(.03);

System.out.println(e);

}

}

This is my Main.java file, how could I run an updateSalary method on this to increase Fred Flinstone's salary by 5%, and decrease Barney Rubbles by 3%.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To run an updateSalary method for adjusting salaries by a certain percentage you need to define the updateSalary method within your Employee class Ill ... View full answer

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!