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
*/
System.out.print( "Please enter your sales: $" );
sales = keyboard.nextInt() ;
System.out.print("Your sales Commissions are: $");
/**
* Loop starts here
*/
}
if(sales < goalSales) // Sales less than 80% of target
{
System.out.print("Your sals Commission is: $");
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.print("Your total Salary IS: ");
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.print("Your Total Earnings are: $");
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.print("Your Total Earnings are: $");
System.out.println(sales * bigcommissionRate + salary);
}
}
}
}
// End program