7 8 9 10 E 11 } 12 13 14 15 16 17 } 18 19...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
7 8 9 10 E 11 } 12 13 14 15 16 17 } 18 19 + 1 72 3 4 5 55 6 Employee.java EmployeeTest.java public class Employee { 3 usages private String name; 3 usages private int salary; 3 usages private String position; public Employee() { public Employee(String name, int salary, String position) { this.name = name; this.salary = salary; position; this.position = public String getName() { return name; 22 23 + public void setName(String name) { this.name = name; } 26 27 + public int getSalary() { return salary; } 30 31 + public void setSalary(int salary) { this.salary = salary; } 34 35 + public String getPosition() { return position; } 38 39 + public void setPosition(String position) { this.position = position; } 42 43 44 45 46 47 H 48 49 50 H 51 52 A } 53 54 public String salaryGradeType(int x){ if (x >= 10000 && x < 20000){ return "C"; } if (x >= 20000 && x < 40000) { return "B"; } if (x > 40000) { return "A"; return "Error"; 55 56 } 57 58 59 60 61 } 62 Employee.java EmployeeTest.java x 1 import org.junit.jupiter.api.*; 2 3 public class EmployeeTest { 4 5 6 7 8 11 12 13 14 System.out.println(" 15 16 private Employee emp; @BeforeEach public void create New Emp() { this.emp = new Employee("Jm", 10000,"Manager"); } @Before All public static void setUp() { System.out.println("Connecting to DataBase"); System.out.println("- "); 17 18 } 19 20 21 24 25 @AfterEach public void clean Employee() { this.emp = new Employee(); } @AfterAll public static void tearDown() { System.out.println(" "); System.out.println("Disconnecting from DataBase"); System.out.println(" "); 26 27 28 29 30 31 } 32 33 34 35 36 37 + 40 41 42 43 + 46 47 48 49 + 52 53 54 A 55 58 59 } 60 @Test @DisplayName("Salary Grade A") public void test1() { System.out.println(this.emp.getName()); } @Test @DisplayName("Salary Grade B") public void test2() { System.out.println(emp.getPosition()); } @Test @DisplayName("Salary Grade C") public void test3() { System.out.println(emp.getPosition()); } @Test @DisplayName("Salary Grade Error") public void test4() { System.out.println(emp.getPosition()); } Create a new Employee class with the following attributes and behaviors. 1. Name 2. Salary 3. Position 4. get salary grade For the salary grade behavior it will return a string/char of A, B, or C. If the salary is greater than or equal to 10,000 and less than 20,000 then return C, for salary greater than or equal to 20,000 and less than 40,000 then return B. For a salary Greater than or equal to 40,000 return A. After creating the employee class create a new test class and create tests with the following expected results. 1. Salary grade will be A 2. Salary Grade will be B 3. Salary Grade will be C 4. Salary Grade will return an error. Use a BeforeEach annotation to create your new Employee object and the BeforeAll and AfterAll annotations to Simulate connecting to the database. 7 8 9 10 E 11 } 12 13 14 15 16 17 } 18 19 + 1 72 3 4 5 55 6 Employee.java EmployeeTest.java public class Employee { 3 usages private String name; 3 usages private int salary; 3 usages private String position; public Employee() { public Employee(String name, int salary, String position) { this.name = name; this.salary = salary; position; this.position = public String getName() { return name; 22 23 + public void setName(String name) { this.name = name; } 26 27 + public int getSalary() { return salary; } 30 31 + public void setSalary(int salary) { this.salary = salary; } 34 35 + public String getPosition() { return position; } 38 39 + public void setPosition(String position) { this.position = position; } 42 43 44 45 46 47 H 48 49 50 H 51 52 A } 53 54 public String salaryGradeType(int x){ if (x >= 10000 && x < 20000){ return "C"; } if (x >= 20000 && x < 40000) { return "B"; } if (x > 40000) { return "A"; return "Error"; 55 56 } 57 58 59 60 61 } 62 Employee.java EmployeeTest.java x 1 import org.junit.jupiter.api.*; 2 3 public class EmployeeTest { 4 5 6 7 8 11 12 13 14 System.out.println(" 15 16 private Employee emp; @BeforeEach public void create New Emp() { this.emp = new Employee("Jm", 10000,"Manager"); } @Before All public static void setUp() { System.out.println("Connecting to DataBase"); System.out.println("- "); 17 18 } 19 20 21 24 25 @AfterEach public void clean Employee() { this.emp = new Employee(); } @AfterAll public static void tearDown() { System.out.println(" "); System.out.println("Disconnecting from DataBase"); System.out.println(" "); 26 27 28 29 30 31 } 32 33 34 35 36 37 + 40 41 42 43 + 46 47 48 49 + 52 53 54 A 55 58 59 } 60 @Test @DisplayName("Salary Grade A") public void test1() { System.out.println(this.emp.getName()); } @Test @DisplayName("Salary Grade B") public void test2() { System.out.println(emp.getPosition()); } @Test @DisplayName("Salary Grade C") public void test3() { System.out.println(emp.getPosition()); } @Test @DisplayName("Salary Grade Error") public void test4() { System.out.println(emp.getPosition()); } Create a new Employee class with the following attributes and behaviors. 1. Name 2. Salary 3. Position 4. get salary grade For the salary grade behavior it will return a string/char of A, B, or C. If the salary is greater than or equal to 10,000 and less than 20,000 then return C, for salary greater than or equal to 20,000 and less than 40,000 then return B. For a salary Greater than or equal to 40,000 return A. After creating the employee class create a new test class and create tests with the following expected results. 1. Salary grade will be A 2. Salary Grade will be B 3. Salary Grade will be C 4. Salary Grade will return an error. Use a BeforeEach annotation to create your new Employee object and the BeforeAll and AfterAll annotations to Simulate connecting to the database.
Expert Answer:
Posted Date:
Students also viewed these programming questions
-
(20 points)Write a program that prompts the user to input five decimal numbers. The program should then add the five decimal numbers, convert the sum to the nearest integer, and print the result....
-
If the focal length of a lens is 3 centimeters and the image distance is 5 centimeters from the lens, what is the distance from the object to the lens?
-
A road building company is purchasing an excavator for $500,000. The corporate tax rate is 45% and the expected after-tax rate of return is 12%. What would be the present value of the future tax...
-
Mien Co. is budgeting sales of 53,000 units of product Nous for October and 60,000 units of product Nous for November. The manufacturing of one unit of Nous requires 4 kilos of chemical Loire. During...
-
In a circus act, a uniform board (length 3.00 m, mass 35.0 kg) is suspended from a bungie-type rope at one end, and the other end rests on a concrete pillar. When a clown (mass 75.0 kg) steps out...
-
Since management and the board receive operating reports from their line organizations: a. Internal auditors should be concerned primarily with reporting the financial results of their audits. b....
-
For each of the following independent cases, find the probability of the process being in control, at which a manager would be indifferent to investigating the source of the variance. Cost of Cost of...
-
Fun Stay Express operates a 100-room hotel near a busy amusement park. During June, a 30-day month, Fun Stay Express experienced a 65% occupancy rate from Monday evening through Thursday evening...
-
In a sample of 800 students in a university, 160 or 20% are Business majors. The 20% is an example of A. a population. B. descriptive statistics. C. a sample. D. statistical inference.
-
A ball is thrown with an initial velocity of 50 m/s at an angle of 60 with the horizontal. Determine: (i) The maximum height reached by the ball (5 marks) (ii) The total time of flight (5 marks)...
-
What are the drivers of omnichannel distribution?
-
A probability that is computed with the knowledge of additional information is called a _______________ probability. In Exercises 710, fill in each blank with the appropriate word or phrase.
-
An outcome or collection of outcomes from a sample space is called an ____________________ . In Exercises 58, fill in each blank with the appropriate word or phrase.
-
Why would a brand select different levels of distribution intensity?
-
In a permutation, order is not important. In Exercises 9 and 10, determine whether the statement is true or false. If the statement is false, rewrite it as a true statement.
-
On January 1, 20x9, First Time Company sold a tract of land that was acquired years ago for P 3M. First time received a three year 15% interest bearing note for P 6M in exchange for the land, but the...
-
Integration is a vital concept when applied in one?s life. Integrating your life means making ideal choices. Perfect choices on the other go in line with quality decisions. Quality decisions lead to...
-
Stone Creek Furniture Factory (SCFF), a custom furniture manufacturer, uses job order costing to track the cost of each customer order. On March 1. SCFF had two jobs in process with the following...
-
Refer to the information in E2-1 for Stone Creek Furniture Factory. Required: Prepare journal entries to record the materials requisitions, labor costs, and applied overhead. Data from E2-1 Stone...
-
A weekly time ticket for Jim Bolton follows: Required: 1. Determine how much of the $1,000 that Jim earned during this week would be charged to Job 271, Job 272, and Job 273. 2. Explain how the time...
Study smarter with the SolutionInn App