# I need help with my java program for college

• February 3rd, 2014, 08:59 PM
Dshelton
I need help with my java program for college
I do not know how to make the loop end. I think there is an issue with my second and thrid algorithms... Someone please help..
Also its a commission calculator

--- Update ---

//Start Program
package commission;
import java.util.Scanner;
public class Commission
{

private static boolean saleTargetrange;

public static void main(String[] args) {

{
Scanner keyboard = new Scanner(System.in);

double salary = 50000.00; // Yearly Salary
double commissionRate = 0.05; // Commision @ 5%
double bigcommissionRate = 0.065; // Commission at 6.5%
double sales = 0;
double goalSales = 96000; //
double commision = commissionRate * sales;
double totalPay = salary + commision ; // Total salary with commision
double salesTarget = 120000; // Gaol to get commission increase.
saleTargetrange = 96000 <= 120000;
double maxSales;
double saleTargetrate = sales * bigcommissionRate; // set sales comminssion
boolean exit = true;
int currentNumber = 0; // the number that will be converted to
String name; // person that made the money

{

--- Update ---

/**
* Enter name and display a greeting message...
*/
System.out.println("Hello Welcome To The Commission Calculator:");// greating message
System.out.print( "Please enter Name:" ); // name of User
name = keyboard.nextLine();

/**
* Yearly Salary
*/
System.out.print( "Your Base Salary is: \$");
System.out.println(salary);

/**
* Entering sales
*/
sales = keyboard.nextInt() ;
/**
* Loop starts here
*/
}

if(sales < goalSales) // Sales less than 80% of target
{
System.out.println(0.00);
System.out.println(" You Did Not Meet The Criteria To Earn A Commission.");
System.out.println("Better Luck Next Time.");
System.out.println(salary);

}
// If true I need to end program here if not carry on to the next loop
else
{
if(sales >= salesTarget) // Sales greater than the 80% but less than 120k

System.out.print("Your Sales Commission is 0.05: \$");
System.out.println(sales * commissionRate);
System.out.println(sales * commissionRate + salary);

}
// If true I need to end program here if not carry on to the next loop

{
if(sales >= 121000) // Sales greater than 120k

System.out.print("Your Sales Commission is 0.06: \$");
System.out.println(sales * bigcommissionRate);
System.out.println(sales * bigcommissionRate + salary);
}

}
}
}

// End program
• February 3rd, 2014, 10:23 PM
aprabhat
Re: I need help with my java program for college

Code java:

```if(sales < goalSales){ //your code }```
then its not a loop, this is a control statement.

If you are getting any error in your code then Please post the full error message.
• February 4th, 2014, 04:38 AM
GregBrannon
Re: I need help with my java program for college