Answered step by step
Verified Expert Solution
Question
1 Approved Answer
GMS ) m IG G G WR | | | G | G github.com/Santa Barbara City College/cs105-kinneavy-f19-a04-employee-chidinmaad README.md This is where your test code
GMS ) m IG G G WR | | | G | G github.com/Santa Barbara City College/cs105-kinneavy-f19-a04-employee-chidinmaad README.md This is where your test code will go. Replace the code in that file with the code in the grey box below: K /** *CS 105 Theory and Practice I * CRN: [CHANGE THIS TO YOUR INFORMATION] * Assignment: Employee * * Statement of code ownership: I hereby state that I have written all of this * code and I have not copied this code from any other person or source. * * @author [CHANGE THIS TO YOUR INFORMATION] */ package edu.sbcc.cs105; /** *This class provides first level testing the Employee object. * */ public class Program { /** * Create an employee and test that the proper name has been created. Test * the initial salary amount and then give the employee a raise. Then check * to make sure the salary matches the raised salary. * * command line values. Not used in this example. */ public static void main(String[] args) { // TODO: Paste code in here from the sample usage section. Feel free to adjust thing * @param args * Similar to the Employee.java file go through Program.java and change the [CHANGE THIS TO YOUR INFORMATION] text to the proper items. There are two items to be changed. } } JMD DeJ zy C | + A > ... GMS ) m K IG G G WR | | | G | G JMD DeJ zy C | + github.com/Santa Barbara City College/cs105-kinneavy-f19-a04-employee-chidinmaad README.md The project name of this exercise is Employee. The purpose of this assignment is to give you some practice problem solving, writing your own classes, and running unit tests. Problem Description Implement a class Employee and test it in your Program**.java**. An employee has a name (a String) and a salary (a double). Your Employee class must follow the provided specification below: A constructor with two explicit arguments: public Employee(String employee Name, double currentSalary) - Constructor. The constructor will initialize instance variables of the same name as provided parameters. That is, it will assign the values from the parameters to the instance variables. Method Declarations / Class Interface **public String getName() - Returns the name of the employee from the instance variable employee Name public double getSalary () - Returns the current salary. It gets this value from an instance variable named currentSalary public void raiseSalary (double by Percent) - Gives the employee a raise according to the explicit argument byPercent. This method will modify the value of the currentSalary instance variable Sample Usage (paste this inside your main() method of Program.Java): Employee harry = new Employee("Harry", 10000); harry.raiseSalary(10); // Harry gets a 10% raise. double harrysSalary = harry.getSalary(); Getting Started A > ...
Step by Step Solution
There are 3 Steps involved in it
Step: 1
To get started with the Employee class implementation and testing in your Programjava file you can follow the steps outlined in the READMEmd file prov...Get Instant Access to Expert-Tailored 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