Question: Help with JAVA assignment please! Exercise 2B [15%] Add three variables to the Employee class: - a private String called name that will contain the

Help with JAVA assignment please!

Help with JAVA assignment please! Exercise 2B [15\%] Add three variables to

Exercise 2B [15\%] Add three variables to the Employee class: - a private String called name that will contain the name of the employee - a private double called monthlySalary that will contain the monthly salary Next add the constructor. Set name and monthlySalary using parameters. Finally add three methods: - a public method called getName with no parameters that returns the name variable - a public method called getMonthlySalary with no parameters that returns the monthlySalary variable - a public method called getAnnualSalary with no parameters that returns the annual salary of the employee formatted to have only two decimal places (e.g. 10.3832 will be returned as 10.38) Exercise 2C [10\%] Add code to Programmer so that the class inherits from Employee. Add one variable to the Programmer class: - a private String called language that will contain the programming language this programmer is skilled in Next add a constructor to Programmer that also receives a String to set name, a double to set monthly salary and a String to set the language. Please look up how to call the constructor of the parent class. Finally add one method: 2 - a public method called getLanguage that returns the programming language

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!