I am having trouble writing a simple commission program. I could really use a tutor or just someone that I can ask questions when needed. Can anyone tell me what I am doing wrong. This is what I need to write
• A salesperson will continue to earn a fixed salary of $50,000. The current sales target for every salesperson is $100,000.
• The sales incentive will only start when 80% of the sales target is met. The current commission is 12% of total sales.
• If a salesperson exceeds the sales target, the commission will increase based on an acceleration factor. The acceleration factor is 1.5.
• The application should ask the user to enter annual sales, and it should display the total annual compensation.
• The application should also display a table of potential total annual compensation that the salesperson could have earned, in $5000 increments above the salesperson’s annual sales, until it reaches 50% above the salesperson’s annual sales.
Sample Table: Assuming a total annual sales of $100,000, the table would look like this:
Total Sales Total Compensation
100,000 <<Program calculated value>>
105,000 <<Program calculated value>>
110,000 <<Program calculated value>>
115,000 <<Program calculated value>>
120,000 <<Program calculated value>>
125,000 <<Program calculated value>>
130,000 <<Program calculated value>>
135,000 <<Program calculated value>>
140,000 <<Program calculated value>>
145,000 <<Program calculated value>>
150,000 <<Program calculated value>>
And this is what I have so far:
import java.util.Scanner;
public class forLoops {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
double salary=50000;
int commission;
int annualCommission = 0;
double targetSales;
double rate=0.12;
double sales = 0;
double x = 0;
Scanner keyboard = new Scanner(System.in);
System.out.print("What were your Total Sales");
sales = keyboard.nextDouble();
x = sales;
for (double x = (double) (); x<=10; x++ ){
System.out.println(x +" "+ (x*x + " "+ x*x*x ));
}
}
==========================================================================================
And this is what I first created and know that it works
package simplecommissioncalculationprogram;
/**
*
* @author Hammer's Laptop
*/
import static java.lang.reflect.Array.get;
import java.util.Scanner;
public class SimpleCommissionCalculationProgram
{
/**
* @param args the command line arguments
*/
// Fixed Annual Salary for SalesPerson
public static void main(String[] args)
{
Scanner input = new Scanner( System.in );
int sales;
int salary=50000;
int commission;
double annualCommission;
int targetSales;
double rate=0.12;
System.out.print("Enter Total Sales $" );
// This is the total annual sales
sales = input.nextInt();
// Since the total sales can differ this is input manually
System.out.println("Your Annual Salary is $" + salary);
// The annual sales are the same for every salesperson
System.out.println("Your Interest Rate is" + rate );
// The interest rate is the same for every sales person
commission = (int) (sales * rate);
System.out.println("Your Commission is" + commission);
annualCommission = commission + salary;
// Calculates total annual compensation for a salesperson
System.out.printf ("Total Annual Commission $%.2f",
get.annualCommission());