Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
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!
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 languageStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started