Java help!! Programming questions

Get perfect grades by consistently using www.assignmentgeeks.org. Place your order and get a quality paper today. Take advantage of our current 20% discount by using the coupon code GET20


Order a Similar Paper Order a Different Paper

I need some help with my program:

import java.util.Scanner;

public class Commission {

    private static double sales;

public static void main(String[] args) {

 //declare variables for arrary

    String salesPerson1;

    String salesPerson2;

   

   

    //number of employees to compare, and initialize array

         int[] aTotal = new int[2];

       

         //new scanner input

         Scanner keyboard = new Scanner(System.in);

       

         //get salesperson1 name

         System.out.println(“What is your first salesperson’s name?”);

         salesPerson1 =  keyboard.nextLine();

       

         //get salesperson1 sales total

         System.out.println(“What was their sales total for the year?”);

         aTotal[0] = (int) keyboard.nextDouble();

       

         //get salesperson2 name

         System.out.println(“What is your second salesperson’s name?”);

         salesPerson2 = keyboard.nextLine();

       

         //get salesperson2 sales total

         System.out.println(“What was their sales total for the year?”);

         aTotal[1] = (int) keyboard.nextDouble();

       

         //This part of the array needs to reference back to the commission

  //Loop for setting name and annual sales of salesperson

       do

       {  

           //Create an Salesperson object

           Salesperson sPerson = new Salesperson();

           //Set salesperson’s name

           System.out.println(“Enter salesperson name”);

           String name = keyboard.nextLine();

           sPerson.setName(name);

           //End while loop

           if (name.equalsIgnoreCase(“Done”))

               break;                    

           //Set annual sales for salesperson

           System.out.println(“Enter annual sales for salesperson”);

           sales = keyboard.nextDouble();

           sPerson.setSales(sales);          

           //To add Salesperson object to ArrayList

           cArray.add(sPerson);

           //Consume line

           keyboard.nextLine();    

       }

       while (true);

       //Display ArrayList

       DecimalFormat arrayL = new DecimalFormat(“#,##0.00”);

       for (int index = 0; index < cArray.size(); index++)

       {

           Salesperson sPerson = (Salesperson)cArray.get(index);

           System.out.println();

           System.out.print(“Salesperson ” + (index + 1) +

                            “n Name: ” + sPerson.getName() +

                            “n Sales: ” + (arrayL.format(sPerson.getSales())) +

                            “n Commission Earned: ” + 

                            (arrayL.format(sPerson.getComm())) +

                            “n Total Annual Compensation: ” 

                            + (arrayL.format(sPerson.getAnnComp())) + “nn”);

       }

         // calcs to add data to the array        

         for (int counter=0; counter < aTotal.length; counter++)

         {

             System.out.printf(“Salesperson: Total”, counter, aTotal[counter]);

         }

             System.out.println(“Salesperson” + “tt” + “Total”);

             //System.out.println(“——————————–“);

       

}

    private static class Salesperson {

        public Salesperson() {

        }

        private void setName(String name) {

            throw new UnsupportedOperationException(“Not supported yet.”); //To change body of generated methods, choose Tools | Templates.

        }

        private void setSales(double sales) {

            throw new UnsupportedOperationException(“Not supported yet.”); //To change body of generated methods, choose Tools | Templates.

        }

    }

    private static class DecimalFormat {

        public DecimalFormat() {

        }

    }

}

//THIS IS WHAT I NEED IT TO DO…

Write a simple commission calculation 

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.

"Is this question part of your assignment? We can help"

ORDER NOW

Writerbay.net

Do you need help with this or a different assignment? We offer CONFIDENTIAL, ORIGINAL (Turnitin/LopesWrite/SafeAssign checks), and PRIVATE services using latest (within 5 years) peer-reviewed articles. Kindly click on ORDER NOW to receive an A++ paper from our masters- and PhD writers.

Get a 15% discount on your order using the following coupon code SAVE15


Order a Similar Paper Order a Different Paper