Employee and employeedriver


To do: EMPLOYEE AND EMPLOYEEDRIVER
Write a class named Employee that has the following instance variables:
• name. A String object that holds the employee's name
• idNumber. An int variable that holds the employee's ID number
• department. A String object that holds the name of the department where the employee works
• position. A String object that holds the employee's job title.
The class should have the following constructors (note - we will only use the first one in our example data, but remember - this is a blue print that can be used in many applications. Other applications might use the other constructors):
• A full constructor that has parameters for all four instance variables
• A constructor that takes in the name and id and sets these values. It sets the department and position to a blank (" ");
• A no-argument constructor 
Write your getters and setters and your toString() method.

Write a driver program named EmployeeDriver that creates the following three employees by calling the full constructor. Then have it print each of them out by calling the toString() method.

Name ID Department Position
Mike Miller 78655 Accounting President
Sam Jones 76798 IT Programmmer
Sally Rogers 98745 Technical Support Help Desk Technician



To do: CAR AND CARDRIVER
Write a class named Car that has the following instance variables:
• year - an int field that has the model year for the car
• make - A String object that holds the make of the car
• speed - an int field that holds the car's current speed
The class should have the following constructors:
• a full constructor where all values are passed in
• a constructor where the year and make are passed in and the speed is set to zero
• a no-argument constructor 
Write your getters and setters and your toString() method.
Write the following methods (I will help you if you need me to - post a note in the discussion forum)
• accelerate() - this method should add five miles to the speed each time it is called. Since this is a constant 5 miles per hour, that should be a constant in the method and there are no need for parameters.
• brake() - this method should subtract ten miles from the speed each time it is called. Since this is a constant 5 miles per hour, that should be a constant in the method and there are no need for parameters.

Write the CarDriver program that creates a Car object calling the full constructor (you can choose values for the arguments). Call the accelerate() method five times and print just the speed after each method call. Call the brake() method once. Then call the toString() method to print out the Car instance.


To do: PAYROLL AND PAYROLLDRIVER
Write a Payroll and PayrollDriver class. The Payroll instance variables should be the employeee's name, ID, hourly pay rate, and number of hours worked. You decide appropriate variable names and data types. Write a full and no-argument constructor, your getters and setters, and a toString() method. Write a method named grossPay() that calculates and returns the gross amount paid. In the Driver, create two instances of the Payroll class. With the first one, call the full constructor (you can use whatever values you like). For the second one, use the no-argument constructor followed by the setters to set the field values (you can use whatever values you like). Call the toString() method to print each out. Also call the grossPay() method and print out the employee's gross pay. Make certain it is formatted like money.
See MoneyExample.java.


Your jar file that you submit needs to be named dwolffmod2.jar (except your name). It must have one package in it named dwolffmod2 (except your name). There should be exactly ten programs in the package: Changes you should have made in this module:
SoftwareSales
ShippingCharges
Book and BookDriver
Employee and EmployeeDriver
Car and CarDriver
Payroll and PayrollDriver

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Employee and employeedriver
Reference No:- TGS094919

Expected delivery within 24 Hours