Problem Part a: Create a class named Commission that includes three variables: a double sales figure, a double commission rate, and an int commission rate. Also create two overloaded methods named computeCommission(). The first method takes two double parameters from the user representing sales and rate, multiplies them, and then displays the results. The second method takes two parameters from the user: a double sales figure and an integer commission rate. This method must divide the commission rate figure by 100.0 before multiplying by the sales figure and displaying the commission. Write a main() method that tests each overloaded method. Save the file as Commission.java
Part b: Add a third overloaded method to the Commission application. The third parameter takes a single parameter representing sales. When the method is called, the commission rate is assumed to be 7.5% and the results are displayed . To test this method , add an appropriate call in the commission program's main () method . Save the file as Commission2.java
I wrote the code and the program doesn't return any errors, but for some reason the program only calls one of three methods. For example, if the user enters $4387.69 for their sales amount and then enters .27 for their commission rate the program will calculate their commission earnings to be $1184.6763, but if the user were to have entered 27 for the commission rate instead if the program calling the appropriate function to convert the that number it runs the same function again.
Can someone please tell me what I'm doing wrong? Here is my code Thanks! ________________________________________________________________
import java.util.Scanner; public class Commission {
Scanner input = new Scanner(System.in); System.out.println(" Enter your total sales amount "); salesFigure3 = input.nextDouble() * .075; System.out.println(" Your commission is $ " + salesFigure3);