Microsoft Word - Exception_Assignment.doc Objected Oriented Programming Exception Handling [Marks: 20] Create an EmployeeException class whose constructor receives a String that consists of an...

1 answer below »
java


Microsoft Word - Exception_Assignment.doc Objected Oriented Programming Exception Handling [Marks: 20] Create an EmployeeException class whose constructor receives a String that consists of an Employee’s ID and pay rate. Create an Employee class with three fields, IDNum, EmployeeName and hourlyWage. The Employee constructor requires values for all three fields. Upon construction, throw an EmployeeException if the hourlyWage is less than 6.00 or over 50.00. Write a test program (containing main method) that establishes at least three employees with hourlyWages that are above, below, and within the allowed range.
Answered Same DayApr 22, 2021

Answer To: Microsoft Word - Exception_Assignment.doc Objected Oriented Programming Exception Handling [Marks:...

Aditya answered on Apr 22 2021
157 Votes
class EmployeeException extends Exception
{
    public EmployeeException(String idNum, double payRate
) {
        super("Employee with id "+idNum +" have wage "+payRate+" have exception");
    }
    
}
public class Employee {
    
    private String idNum;
    private String name;
    private double wage;
    
    public Employee(String idNum, String name,...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here