The code below is what I have. I am a fairly new programmer going through my first Java class so bear with me.
import salespersonannualcomp.SalespersonCompensationAnnualCalculator; import java.util.Scanner; public class SalespersonAnnualSalesInput { public static void main( String[] args) { Scanner input = new Scanner( System.in ); //Instantiates a new instance of SalespersonCompensationAnnualCalculator SalespersonCompensationAnnualCalculator myAnnualSales = new SalespersonCompensationAnnualCalculator(); //Prompt for and input total annual sales System.out.println( "Please enter the total annual sales:" ); String yearlySalesString = input.nextLine(); //Declares yearlySalesInt as the variable that will store the results of Integer.parseInt int yearlySalesInt = Integer.parseInt(yearlySalesString); //Declares calcResults as the variable that will store the value created by the calcAnnualCompensation method double calcResults = myAnnualSales.calcAnnualCompensation(yearlySalesInt); //Displays the result of the calculations done for determining total annual compensation System.out.println(" Total Annual compensation is $"+ calcResults); System.out.println(); System.out.println(" Total Potential Annual Compensation Chart"); for(double potentialAnnualSales = yearlySalesInt;potentialAnnualSales<=(1.5*yearlySalesInt);potentialAnnualSales=potentialAnnualSales+5000) { double calcAnnualCompensation=myAnnualSales.calcAnnualCompensation(potentialAnnualSales); System.out.printf( "%f %f%n ",potentialAnnualSales,calcAnnualCompensation); } } } The resulting output looks like this.
Total Annual compensation is $60400.0 Total Potential Annual Compensation Chart 160000.000000 60400.000000 165000.000000 60725.000000 170000.000000 61050.000000 175000.000000 61375.000000 180000.000000 61700.000000 185000.000000 62025.000000 190000.000000 62350.000000 195000.000000 62675.000000 200000.000000 63000.000000 205000.000000 63325.000000 210000.000000 63650.000000 215000.000000 63975.000000 220000.000000 64300.000000 225000.000000 64625.000000 230000.000000 64950.000000 235000.000000 65275.000000 240000.000000 65600.000000 I would like for it to not display the decimal places, and for all the lines to align correctly. I have the output correct but I'm struggling with the formatting.