Update of /cvsroot/ordweb/uop/pos407/wayneh/week4
In directory sc8-pr-cvs1:/tmp/cvs-serv26855
Modified Files:
ThrowEmployee.java Employee.java
Added Files:
EmployeeException.java
Removed Files:
ThrowException.java
Log Message:
init
--- NEW FILE: EmployeeException.java ---
public class EmployeeException extends Exception
{
public EmployeeException(String s)
{
super(s);
}
}
Index: ThrowEmployee.java
===================================================================
RCS file: /cvsroot/ordweb/uop/pos407/wayneh/week4/ThrowEmployee.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ThrowEmployee.java 24 Jul 2003 17:37:40 -0000 1.1
--- ThrowEmployee.java 24 Jul 2003 18:11:47 -0000 1.2
***************
*** 1,8 ****
/*
* Created on Jul 24, 2003
! *
! * To change the template for this generated file go to
! * Window>Preferences>Java>Code Generation>Code and Comments
! */
/**
--- 1,12 ----
/*
* Created on Jul 24, 2003
! */
! /** Create an EmployeeException class whose constructor receives a String
! * that consists of an employee's ID and pay rate. Create an Empoyee class with two
! * field, idNum and hourlyWage. The Employee costructor requires values for both
! * fields. Upon construction, throw and EmployeeException if the hourlyWage is less
! * than $6.00 or over $50.00. Write a program that establishes at least three Employees
! * with hourlyWages that are above, below, and within the allowed range.
! */
/**
***************
*** 21,25 ****
Employee thirdEmp = new Employee(3690,50.00);
}
! catch
{
System.out.println("Employee error: "+ error.getMessage());
--- 25,29 ----
Employee thirdEmp = new Employee(3690,50.00);
}
! catch(EmployeeException error)
{
System.out.println("Employee error: "+ error.getMessage());
Index: Employee.java
===================================================================
RCS file: /cvsroot/ordweb/uop/pos407/wayneh/week4/Employee.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Employee.java 24 Jul 2003 17:37:40 -0000 1.1
--- Employee.java 24 Jul 2003 18:11:47 -0000 1.2
***************
*** 13,22 ****
{
int idNum;
! float hourlyWage;
! public Employee(int inNum, float inWage) throws EmployeeException
{
idNum = inNum;
hourlyWage = inWage;
! if (inWage < 6) throw (new EmployeeException(hourlyWage));
}
}
--- 13,26 ----
{
int idNum;
! double hourlyWage;
! public Employee(int inNum, double inWage) throws EmployeeException
{
idNum = inNum;
hourlyWage = inWage;
!
! if (inWage < 6.00) {
! String sTemp = "Error in employee" + inNum;
! throw (new EmployeeException(sTemp));
! }
}
}
--- ThrowException.java DELETED ---
|