Create an employeeexception class whose constructor


1. Create an abstract class named Publication. This class should define an abstract method getPublicationType() and a nonabstract method getTitle() that returns the value of a title data field as well as a setTitle() method used to set the title data field. The toString() method of the Publication class should concatenate the result of getPublicationType() with getTitle(). Create two subclasses of Publication-Magazine and Book-that each implement the getPublicationType() method. Finally, create a PublicationDemo class with a main() method that creates an instance of both Magazine and Book and prints the result of the toString() method.

2. Repeat the above exercise, but make Publication an interface rather than an abstract class.

3. Create an EmployeeException class whose constructor receives a String that consists of an employee's ID and pay rate. Create an Employee class with two fields, idNum and hourlyWage. The Employee constructor requires values for both fields. Upon construction, throw an 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. Save the program as ThrowEmployee.java.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Create an employeeexception class whose constructor
Reference No:- TGS0645483

Expected delivery within 24 Hours