Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

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 »
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 XXXXXXXXXXWrite 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 Day Apr 22, 2021

Solution

Aditya answered on Apr 22 2021
159 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