import java.util.Scanner;
public class Project2 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int HE = 1, PE = 2, SA = 3;
int employeeType = 0;
int weeklySal= 0,hoursWorked = 0;//Hourly-based Employees (HE)
int salaryDue =0;
int numberPieces = 0,wage_Per_peice = 0; //For Piece-based Employees(PE)
double items_sold = 0, baseSalary = 0;
double employeeCommission = 0,commissionDue = 0;
System.out.println("Employee Type: HE (1), PE (2), SA (3)");
employeeType = input.nextInt();
while ( employeeType == 1){
System.out.println("Please enter # hours worked: ");
hoursWorked = input.nextInt();
if ( hoursWorked > 70){
System.out.println("Hours need be less than 71 weekly: ");
}
System.out.println("Please enter hourly pay: ");
weeklySal = input.nextInt();
salaryDue = weeklySal * hoursWorked;
System.out.println("Weeks Pay: " + salaryDue);
System.exit( 0 );
}
while ( employeeType == 2){
System.out.println("Please enter # of pieces produced: ");
numberPieces = input.nextInt();
System.out.println("Please wage per piece: ");
wage_Per_peice = input.nextInt();
salaryDue = numberPieces * wage_Per_peice;
System.out.println("Weeks Pay: " + salaryDue);
System.exit( 0 );
}
while ( employeeType == 3){
System.out.println("Please enter # items sold: ");
items_sold = input.nextDouble();
System.out.println("Please weekly base salary: ");
baseSalary = input.nextDouble();
System.out.println("Please enter your commision: ");
employeeCommission= input.nextDouble();
[COLOR="red"]salaryDue = items_sold * baseSalary;[/COLOR]
commissionDue = salaryDue * employeeCommission;
System.out.println("Weeks Pay: " + commissionDue);
System.exit( 0 );
}
}
}
Red is the line in question.....
Edited by yourmom615, 21 March 2011 - 06:32 PM.
New Issue


Sign In
Create Account


Back to top









