I'm working on an assignment that states this:
Modify the Week Two Java™ application using Java™ NetBeans™ IDE to meet these additional and changed business requirements:
The company has recently changed its total annual compensation policy to improve sales.
A salesperson will continue to earn a fixed salary of <Add salary figure from Week Two here>. The current sales target for every salesperson is < Add a target sales figure here (e.g. $120,000)>.
The sales incentive will only start when 80% of the sales target is met. The current commission is <Add percentage here> of total sales.
If a salesperson exceeds the sales target, the commission will increase based on an acceleration factor. The acceleration factor is <Add a number greater than 1 (e.g. 1.25)>.
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.
The Java™ application should also meet these technical requirements:
The application should have at least one class, in addition to the application’s controlling class.
The source code must demonstrate the use of conditional and looping structures.
There should be proper documentation in the source code.
So here is the code I have come up with, but I keep getting these errors:
Main.java:56: error: possible loss of precision
for (projSales=sales+5000;projSales <= maxSales; projSales +=5000)
^
required: int
found: double
Main.java:58: error: package system does not exist
system.out.println(projSales + "\t\t" + accel); "
class NewProgram { public static void main (String[] args) { double salary; //salesperson's salary double sales; //sales amount for year double commission; // commission without incentives double incentive; //when incentive kicks in double accel; //commission accelerated factor double salesTarget; // is half the salary plus 10,000$ double totalIncentiveEarned; //total made from incentive program double totalIncome; //salary + totalIncentiveEarned double maxSales; //for the table to show 50 percent above the annual sales Scanner keyboard= new Scanner(System.in); //Enter Salary System.out.print("What is salesperon's fixed salary?"); salary=keyboard.nextDouble(); //Enter Salespersons sales for year System.out.print("What was their sales for the year?"); sales=keyboard.nextDouble(); commission= sales * .05; salesTarget=(salary * .5); incentive=.8*salesTarget; accel=commission*1.5; int projSales; if (incentive >= 80% salesTarget) { accel=sales*1.5; System.out.println("Congrats you qualify for the new incentive program!"); totalIncome=accel+salary; System.out.println("Your commission for the new program is " + accel); System.out.println("Your total income for the year is " + totalIncome); } else { System.out.println("You did not qualify for the sales incentive program"); System.out.println("Your total commission was" + commission); System.out.println("Your total income for the year is" + totalIncome); } System.out.print("Your potential earnings were"); for (projSales=sales+5000;projSales <= maxSales; projSales +=5000) { system.out.println(projSales + "\t\t" + accel); } } }
I also cant figure out why the:System.out.print("Your potential earnings were"); for (projSales=sales+5000;projSales <= maxSales; projSales +=5000) { system.out.println(projSales + "\t\t" + accel);
wont export into table format, it increasing the originally entered sales amount by 5000 and showing the potential compensation