Java Need my table to work with a seperate class file and configure to user input of data
<p>I have an assignment that's due today in about 13 hours, I have completed everything that's required by the assignment, however now my table doesn't work which is in a seperate class file. The table technically isn't needed, however I want to keep it but don't know how to get it to work with the new information in my files.</p>

<p>What I need is for this table to somehow work with my array. The table needs to take the information that is input by the user in <code>AnnualSales[0]</code>, and <code>AnnualSales[1]</code> and display in increments of $5,000 from $120,000 - $180,000 if the sales person made less than $120,000. If the Sales Person made more than $120,000 the table needs to show in increments of $5,000 up from what the sales person made in annual sales up to 1.5 times the amount they made. If they make over $96,000 which is 80% of $120,000 they will get a 5% commission of the sales. If they make over $120,000 they will get an added 1.5% acceleration rate added to the 5% commission to make it 6.5% total after $120,000.</p>

<p>The table will increment basically what they would have made if they had made $5,000 more than what they made up to 1.5 times the amount they made. On $120,000 the table will go up to $180,000 in increments of say $120,000, $125,000, $130,000, $135,000 - $180,000 which is 1.5 times the $120,000. Can someone help me to recode this so that it works properly in my coding.</p>

<p><code>Table.java</code> is the file that i'm using for my table. <code>AnnualCompensation.java</code> is the file that it needs to work with. They are both in my package called "SimpleCommission". I will post the coding for both in this question:</p>

<p><strong>AnnualCompensation.java:</strong></p>

<pre><code>package SimpleCommission;

// This allows for user input.
import java.util.Scanner;

public class AnnualCompensation // Created class AnnualCompensation.
{ // Starts the class AnnualCompensation body

    public static void main(String[] args) // Creates a method called main.
    { // Starts the body of the main method.

        // This creates variables to store information.
        double Salary;
        double Sales;
        double Commission;
        double Bonus;
        double AnnualCompensation;
        Salary = 75000; // Sets the salary to a fixed $75,000.

        String[] SalesPerson = new String[2]; // Creates an array using a string.
        int[] AnnualSales = new int[2]; // Creates an array using an integer.

        // Activates the user input allowing for input to be used to get information.
        Scanner input = new Scanner(System.in);

        // Asks the user to input the name of the 1st Sales Person.
        System.out.println("What's the 1st Sales Person's Name?");
        SalesPerson[0] = input.nextLine();

        // Asks the user to input the name of the 2nd Sales Person.
        System.out.println("What's the 2nd Sales Person's Name?");
        SalesPerson[1] = input.nextLine();

        // Asks the user to input the annual sales for the 1st Sales Person.
        System.out.println("What's the 1st Sales Person's Annual Sales?");
        AnnualSales[0] = input.nextInt();

        // Asks the user to input the annual sales for the 2nd Sales Person.
        System.out.println("What's the 2nd Sales person's Annual Sales?");
        AnnualSales[1] = input.nextInt();

        // Creates a variable to store information.
        double Total;

        // Sets the program to respond if the input for AnnualSales[0] is less
        // Than the input for AnnualSales[1].
        if(AnnualSales[0] &lt; AnnualSales[1])
        { 
            // Prints out the 1st &amp; 2nd Sales Person's name's.
            System.out.println("\n" + SalesPerson[0] + "\t" + "\t" + SalesPerson[1]);

            // Subtracts the input for AnnualSales[0] from the input for 
            // AnnualSales[1] to show the amount necessary to be equal.
            Total = (AnnualSales[1] - AnnualSales[0]);

            // Prints out the total amount of annual sales for Sales Person 1 &amp; 2.
            System.out.println(AnnualSales[0] + "\t" + "\t" + AnnualSales[1]);

            // Prints out the amount Sales Person 1 would need to Sell in order to
            // have sold the same amount as Sales Person 2.
            System.out.println(SalesPerson[0] + " needs to sell " + Total 
                               +" To equal the amount " + SalesPerson[1] + " Sold.");
        }

        // Sets the program to respond if the input for AnnualSales[1] is less
        // Than the input for AnnualSales[0].
        if(AnnualSales[1] &lt; AnnualSales[0])
        {
            // Prints out the 1st &amp; 2nd Sales Person's name's.
            System.out.println("\n" + SalesPerson[0] + "\t" + "\t" + SalesPerson[1]);

            // Subracts the input for AnnualSales[1] from the input for
            // AnnualSales[0] to show the amount necessary to be equal.
            Total = (AnnualSales[0] - AnnualSales[1]);

            // Prints out the total amount of annual sales for Sales Person 1 &amp; 2.
            System.out.println(AnnualSales[0] + "\t" + "\t" + AnnualSales[1]);

            // Prints out the amount Sales Person 2 would need to Sell in order to
            // have sold the same amount as Sales Person 1.
            System.out.println(SalesPerson[1] + " needs to sell " + Total 
                               +" To equal the amount " + SalesPerson[0] + " Sold.");
        }
        // If the amounts don't equal the above else is used to show that the amounts are equal
        // to each other and displays seperate information.
        else
        {
            // Allows the information to be compared and if AnnualSales[0] is equal to
            // AnnualSales[1] this part of the program runs.
            if(AnnualSales[0] == AnnualSales[1])
            { 
                // Prints the name's of Sales Person 1 &amp; Sales Person 2.
                System.out.println("\n" + SalesPerson[0] + "\t" + "\t" + SalesPerson[1]);

                // Prints out the amount of Annual Sales for Sales Person 1 &amp; Sales Person 2.
                System.out.println(AnnualSales[0] + "\t" + "\t" + AnnualSales[1] 
                               + "\n" + SalesPerson[0] + " &amp; " + SalesPerson[1] 
                               + " Sold the same amount.");

            }
        }
            if(AnnualSales[0] &gt;= 96000) // Runs if Annual Sales are over $96,000 otherwise is skipped.
            { // Starts the body of the if clause.
                Commission = (AnnualSales[0] * .05); // Sets the value of Commission to 5%.

            // Prints out the total amount of commission.
            System.out.println("For " + SalesPerson[0] + " The total commission is: $"
                              + Commission);

            if(AnnualSales[0] &gt;= 120000) // Nested if clause only runs if Annual Sales are over $120,000
            { // Starts the body of the nested if clause.                

                Bonus = (AnnualSales[0] * .015); // Sets the value of Bonus to 1.5%.

                // Prints out the total amount of the Bonus.
                System.out.println(SalesPerson[0] + " reached the sales target of "
                                  + "$120,000");

                // Sets Annual Compensation to total of Salary, Commission, &amp; Bonus all together.
                AnnualCompensation = (Bonus + Commission + Salary);

                // Prints out the amount of Annual Compensation.
                System.out.println("The total annual compensation for " + SalesPerson[0] 
                                   + " is: $" + AnnualCompensation );
            } // Ends the body of the nested if clause.

            else // Creates a nested else clause which only runs if the nested if is skipped.
            { // Starts the body of the nested else clause.                

                //Prints that the salesperson didn't get the incentive bonus.
                System.out.println(SalesPerson[0] + " didn't meet the sales target "
                                   + "&amp; doesn't get a bonus.");


                // To calculate the total yearly compensation without the bonus

                // Sets Annual Compensation to total of Fixed Salary &amp; Commission together.
                AnnualCompensation = (Salary + Commission);

                // Prints the amount of Annual Compensation.
                System.out.println("The total annual compensation for "
                      + SalesPerson[0] + " is: $" + AnnualCompensation );
            } // Ends the body of the nested else clause
            } // Ends the body of the if clause.

            else // Creates an else clause which only runs if the if clause is skipped.
            { // Starts the body of the else clause


                // Prints that the Salesperson didn't reach 80% of the Sales Target
                System.out.println(SalesPerson[0] + " didn't meet 80% of Sales Target "
                              + "so there is no extra commission or bonus. ");

                // Sets the Annual Compensation to the amount of the Fixed Salary.
                AnnualCompensation = Salary;

                // Prints the amount of Annual Compensation without the commission &amp; bonus.
                System.out.println("The total annual compensation for " + SalesPerson[0] + 
                                   " is: $" + AnnualCompensation );
            } // Ends the body of the else clause.

            if(AnnualSales[1] &gt;= 96000) // Runs if Annual Sales are over $96,000 otherwise is skipped.
            { // Starts the body of the if clause.

                Commission = (AnnualSales[1] * .05); // Sets the value of Commission to 5%.

                // Prints out the total amount of commission.
                System.out.println("For " + SalesPerson[1] + " The total commission is: $"
                              + Commission);

            if(AnnualSales[1] &gt;= 120000) // Nested if clause only runs if Annual Sales are over $120,000
            { // Starts the body of the nested if clause.

                Bonus = (AnnualSales[1] * .015); // Sets the value of Bonus to 1.5%.

                // Prints out the total amount of the Bonus.
                System.out.println(SalesPerson[1] + " reached the sales target of "
                                  + "$120,000");

                // Sets Annual Compensation to total of Salary, Commission, &amp; Bonus all together.
                AnnualCompensation = (Bonus + Commission + Salary);

                // Prints out the amount of Annual Compensation.
                System.out.println("The total annual compensation for " + SalesPerson[1] + 
                                   " is: $" + AnnualCompensation );   
            } // Ends the body of the nested if clause.           
            else // Creates a nested else clause which only runs if the nested if is skipped.
            { // Starts the body of the nested else clause.

                //Prints that the salesperson didn't get the incentive bonus.
                System.out.println(SalesPerson[1] + " didn't meet the sales target "
                                   + "&amp; doesn't get a bonus.");


                // To calculate the total yearly compensation without the bonus

                // Sets Annual Compensation to total of Fixed Salary &amp; Commission together.
                AnnualCompensation = (Salary + Commission);

                // Prints the amount of Annual Compensation.
                System.out.println("The total annual compensation for " + SalesPerson[1] +
                                   " is: $" + AnnualCompensation );
            } // Ends the body of the nested else clause
            } // Ends the body of the if clause.
            else // Creates an else clause which only runs if the if clause is skipped.
            { // Starts the body of the else clause


                // Prints that the Salesperson didn't reach 80% of the Sales Target
                System.out.println(SalesPerson[1] + " didn't meet 80% of Sales Target "
                              + "so there is no extra commission or bonus. ");

                // Sets the Annual Compensation to the amount of the Fixed Salary.
                AnnualCompensation = Salary;

                // Prints the amount of Annual Compensation without the commission &amp; bonus.
                System.out.println("The total annual compensation for " + SalesPerson[1] + 
                                   " is: $" + AnnualCompensation );

            } // Ends the body of the else clause.
            Table Table = new Table();
            Table.CompTable();
    } // Ends the main method of Trial Class.
} // Ends the Trial class.
</code></pre>

<p><strong>Table.java:</strong></p>

<pre><code>package SimpleCommission;

public class Table // Creates the class Table.
{ // Starts the body of the class Table

    public void CompTable() // Creates method CompTable.
    { // Starts the body of the CompTable method.

        //Prints out what this table is for.
        System.out.println("This Is The Potential Total Annual Compensation " 
                           + "That The Salesperson Could Have Made:");

        double Sales = 120000; //Sets the Sales total to $120,000.
        double Max = Sales * 1.50; //Sets the max total this while loop will run to.

        /**********************************************************************
         * Below is the while loop being used to bring the table of what the  *
         * salesperson would potentially make at each amount in increments of *
         * $5,000 starting at the annual sales total of $120,000 and going to *
         *              50% above the salesperson's annual sales.             *
         *********************************************************************/

        while(Sales &lt;= Max) //This sets the while loop to start at minimum &amp; end at the max
        { // This starts the body of the while loop.

            //This sets the Incentive rate's to progress in the table properly.
            double Incentive = Sales * 0.065;

            //This prints out a line for each of the levels of annual sales &amp; incentives.
            System.out.println("For: $" + Sales
                                + "   The incentive is: $" + Incentive);

            //This sets the sales to increase +$5,000 each time the while loop runs so that it 
            //progresses and stops at the max which is 50% above the $120,000 annual sales.
            Sales = Sales + 5000;
        } //Ends the body of the while loop.
    } //Ends the body of CompTable method.
} //Ends the body of the class Table
</code></pre>

<p>Now this is the assignment details, as you can see this isn't part of the assignment, however i'd like help figuring this out for future knowledge to help me understand Java better for my own benefit. Here is the assignment details:</p>

<p>Individual
Write a simple commission calculation program using IDE.
* Modify the Week Three Java™ application using Java™ NetBeans™ IDE to meet these additional and changed business requirements:
* The application will now compare the total annual compensation of at least two salespersons.
* It will calculate the additional amount of sales that each salesperson must achieve to match or exceed the higher of the two earners.
* The application should ask for the name of each salesperson being compared. </p>

<p>The Java™ application should also meet these technical requirements:</p>

<ul>
<li>The application should have at least one class, in addition to the application’s controlling class.</li>
<li>The source code must demonstrate the use of Array or ArrayList.</li>
<li>There should be proper documentation in the source code.</li>
</ul>

<p>So if someone can help me out with this ASAP it would be greatly appreciated, i'm really having problems getting this to work in my other class and adjust to the amount entered. Thanks in advance.</p>
