import java.util.Scanner;
class EmployeeInfo
{
private double wage;
private double hours;
private String empName;
public EmployeeInfo()
{
wage = 0.0;
hours = 0.0;
empName = "";
}
public void setwage(double wage)
{
wages = wage;
}
public double getwage()
{
return wages;
}
public void sethours(double hours)
{
hours = hours;
}
public double gethours()
{
return hours;
}
public void setempName(String name)
{
employeeName = empName;
}
public String getempName()
{
return empName;
}
public double calculateWeeklyPay()
{
return wages * hours;
}
} // end class
import java.util.Scanner;
// Anthony NMontemayor
// Payroll Program pt 2
// 9/1/14
public class Pay3
{
//main method to execute program
public static void main (String args[] )
{
//main execution
Scanner input = new Scanner( System.in );
//variables
String empName;
float wage;
float hours;
float pay;
double overTimePay;
boolean stop=false;
while( !stop ){
System.out.printf( "Enter employee name or 'stop' to exit:"); // Asks for users name if they want to exit enter 'stop'
empName = input.next();
if(empName.equalsIgnoreCase("stop")) // if 'stop' is entered program will exit, if not continue
stop = true;
else{
System.out.printf( "What is the hourly rate?"); // promts user for his/her hourly rate
wage = input.nextFloat();
while (wage <=0)
{
System.out.print("Please enter an amount above 0 dollars"); // enters in dollars
wage = input.nextFloat();
}
System.out.print( "How many hours?"); // states how many hours worked
hours = input.nextFloat();
while (hours <=0)
{
System.out.print("Please enter an amount above 0 hours:"); // repeats how many hours
hours = input.nextFloat();
}
pay = hours * wage;//multiplication
//using printf and println
System.out.println("Employee:" + empName); // States users name
System.out.printf("Hourly Rate: $%.2f\n", wage); // states users hourly rates
System.out.println("Regular Hours worked:" + hours); // states users hours worked in a week
System.out.printf("Gross Pay: $%.2f\n", pay); // states gross pay
}
}
}//end main
}//end class
Right now I'm getting an error saying in line 83 and 84 Error: class, interface, or enum expected import java.until.Scanner;
java.lang.double;
I'm sure it's an easy fix but I'm puzzeled I've tried numberous of solutions and I'm stuck.