I have been working on this array problem since last Friday. We are to accept an employee's gross sales, multiply that by 9%(to find commission) add $200 for weekly salary. Then the program takes that dollar amount and tallies payroll with ( *'s) beside salary groupings....
ex
$200-299 ****
$300-399 **
$400-499* ......ect
my problem is I can't get this to complie to even see how close I am. My compiler keeps giving this error...
\Sales.java:30: ')' expected
salary = (double 200 + (grossSales * .09 ));
^
java:30: ';' expected
java:30: ';' expected
salary = (double 200 + (grossSales * .09 ));
^
I'm lost and frustrated and need some advice......Here is what I have
/import java.util.Scanner;
public class Sales
{
//counts number or salespersons in different salary ranges
public void countRanges()
{
Scanner input = new Scanner( System.in );
double salary;//salespersons pay
double grossSales;//sales to base commission of 9% on
//ininialize the values in the array to zero
salary = 0;
grossSales = 0;
//read in values and assign them to the appropriate ranges
System.out.print( "Enter Gross Sales or enter a negative number to exit" );
dollars = input.next.Int();
grossSales = dollars;
while ( dollars >= 0 )
{
//calculate salary an get range by salary/100
salary = (double 200 + (grossSales * .09 ));
range = ( salary/100 );
if ( range > 10 )
range = 10;
//count totals for every range
for ( int counter = 0; counter < array.length; counter++ )
total += array[ counter ];
if ( counter == 10 )
System.out.printf( "%5d: ", 1000 );
else
System.out.printf( "%3d-%3d: ", counter * 100, counter * 100 + 9 );
//enter next sales amount (negative to end)
System.out.print( "Enter next Gross Sales or enter a negative number to exit" );
grossSales = input.nextInt();
}//end while
//print chart
for ( int stars = 0; starts < array [counter]; star++ )
System.out.print( "*" );
}//end method countRanges
}//end class Sales