Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a class JuniorSalesman that inherits from Hourly (Listing 10.7 is availabl

ID: 664657 • Letter: W

Question

Write a class JuniorSalesman that inherits from Hourly (Listing 10.7 is available online in examples from textbook "Java Software Solutions by Lewis and Lofrus"). A JuniorSalesman is paid an hourly rate, but also earns a commission on his sales.

The JuniorSalesman class has

// a single constructor
public JuniorSalesman(String name, String address, String phoneNumber, String socSecNumber, double hourlyRate, double commissionRate)

// mutator to add the given amount to total sales
public void addSales(double partialSales)


// mutator
// override the pay method to include hourly pay plus commission.  
// For commission calculation, see Listing 10.6 also available online , Executive.pay.
// total sales are reset to 0.
public double pay()

// accessor
public String toString()



Write a class SalesFloor with a main method to test your JuniorSalesman. Create two Hourly and two JuniorSalesman objects. Update all four objects' hours twice. Update the JuniorSalesman's objects' sales twice. Display the pay for all employees.

Explanation / Answer

import java.util.InputMismatchException; import java.util.Scanner; import java.util.Stack; public class TSPNearestNeighbour { private int numberOfNodes; private Stack stack; public TSPNearestNeighbour() { stack = new Stack(); } public void tsp(int adjacencyMatrix[][]) { numberOfNodes = adjacencyMatrix[1].length - 1; int[] visited = new int[numberOfNodes + 1]; visited[1] = 1; stack.push(1); int element, dst = 0, i; int min = Integer.MAX_VALUE; boolean minFlag = false; System.out.print(1 + " "); while (!stack.isEmpty()) { element = stack.peek
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote