I have my project done in NetBeans, and it runs fine with no errors. However, when I try to compile the main class it says : C:\Users\Lynn\Documents\NetBeansProjects\EmployeeInfo\src\employeeinfo>javac Emp
loyeeInfo.java
EmployeeInfo.java:35: cannot find symbol
symbol : class Name
location: class employeeinfo.EmployeeInfo
Name saveInfo;
^
EmployeeInfo.java:83: cannot find symbol
symbol : class Name
location: class employeeinfo.EmployeeInfo
saveInfo = new Name (employee, rate, hours, totalPay);
^
from the command prompt.
Here is my code:
/*Modify the Payroll Program so that it uses a class to store and retrieve
*the employee's name, the hourly rate, and the number of hours worked. Use
*a constructor to initialize the employee information, and a method within
*that class to calculate the weekly pay. Be sure that the method considers
*payment of overtime. Once stop is entered as the employee name, the
*application should terminate. Make sure the program maintains all the
*functionality required in previous assignments and your source code
*readable and well documented.
*To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package employeeinfo;
/**
*
* @author Lynn
*/
import java.util.Scanner;
public class EmployeeInfo {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
String employee = null;
double rate;
int hours;
int count = 0; // number of employees
int overTimeHours;
double totalPay = 0;
EmpInfo saveInfo;
Scanner input = new Scanner(System.in);
int counter;
counter = 0;
boolean moreEmps = true;
System.out.println("Welcome to the employee payroll program:");
System.out.println("Enter stop to quit");
while (moreEmps) {
System.out.println("Enter employees last name, first name, ");
employee = input.next();
if(employee.equalsIgnoreCase("stop"))
{
moreEmps = false;
System.out.println("Thank you for using the payroll program. ");
}
else
{
counter++;
System.out.println("Enter employees pay rate per hour: $");
rate = input.nextDouble();
// prompt for user to enter positive rate amount
while (rate <=0){
System.out.println("Please enter a valid positive rate amount.");
rate = input.nextDouble();
}
System.out.println("Enter employees weekly hours: ");
hours = input.nextInt();
while (hours <= 0){
System.out.println("Please enter a positive amount of hours worked.");
input.nextInt();
}
saveInfo = new EmpInfo (employee, rate, hours, totalPay);
System.out.println("Employee: " + saveInfo.getemployee());
System.out.println("Employee: " + saveInfo.getrate());
System.out.println("Employee: " + saveInfo.gethours());
System.out.println("Total Pay: $" + saveInfo.gettotalPay());
System.out.println("Total employees entered: " + counter);
}
}
}
}