Hello I am almost finished with my assignment but I just need it to do the math correctly and I need help!!! I can easily do the problem on paper just fine however I can't get Netbeans to create the right answer. Here is the problem I need it to calculate
85,000 + (Sales x .10) = Annual compensation
Please help me or point me in the right direction. Thank you all!
//***
// Please enter total annual sales
//
// 85,000 + (Sales x .10) = Annual compensation
//***
package annualcompensation;
import java.util.Scanner;
import java.text.DecimalFormat;
public class annualcompensation
{
public static double calculateannualcompensation(double sales, double compensation)
{
double salesAmount = compensation;
sales /= 100;
salesAmount *= sales;
return salesAmount;
}
public static void main(String args[])
{
DecimalFormat df = new DecimalFormat("0.##");
double compensation;
double sales;
double salesAmount;
Scanner scan = new Scanner(System.in);
System.out.println("Enter in the sales earned for the year");
sales = scan.nextDouble();
System.out.println("Enter in the annual salary");
compensation = scan.nextDouble();
salesAmount = calculateannualcompensation(sales, compensation);
compensation += salesAmount;
System.out.println("Total Sales tax: " + salesAmount);
System.out.println("Total cost of the item (with sales tax): " + df.format(compensation));
}
}
//85,000 + (Sales x .10) = Annual compensation becomes 85000 + (y*.10)= x