Question: must be in java Create a package named: LastFirstInitialExam1 Create a class called Payroll (Be sure and comment all your work) Create an instance variable

must be in java

Create a package named: LastFirstInitialExam1

Create a class called Payroll (Be sure and comment all your work)

Create an instance variable called payCheck. It should be an integer. Also, create an instance String variable called name.

Create a default constructor that sets the variable payCheck to 0 and name to blank.

Create a constructor that sets the variable payCheck to 0 and the name to a parameter.

Create a method called calculatePaycheck. This method should have two explicit parameters, the number of hours worked as an integer and the payRate as an integer. (They are separated by a comma). This method should calculate the payCheck by multiplying (*) by the number of hours by the payRate.

Create a method called getName() to return the name.

Create a method called getPayCheck to return the payCheck value.

Create a class called PayrollTester. This is the main with the plumbing.

Create an object called Dummy which uses the default constructor.

Print the name associated with the object Dummy from step 10 using the getName() method.

Print the payCheck associated with the object Dummy from step 10 using the getPayCheck() method.

Create an object called Me which use your name as the parameter.

Call the calculatePaycheck method using 40 hours and 10 dollars.

Print the name associated with the object Me from step 13 using the getName() method.

Print the payCheck associated with the object Me from step 13 using the getPayCheck() method.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!