Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You will create a Java application that is used to determine a pay check and display the net pay and its details on the screen.

You will create a Java application that is used to determine a pay check and display the net pay and its details on the screen. PayCheck Class fields: hourlyRate, hoursWorked, grossPay, federalTaxAmount, stateTaxAmount, FICAAmount, lastName, firstName constants: FEDERAL_TAX_RATE, STATE_TAX_RATE, FICA_RATE no-args (default) constructor which sets the numeric fields (including contants) to 0 and the names to unknown and the constants to : 0.15, 0.09 and 0.07 a second constructor (overloaded) which allows the user to set the initial values of the fields (including the constants). Do not be concerned that the driver will not use this constructor.

Methods: setLastName( ) setFirstName ( ) setHourlyRate( ) do data validation in this method., do not accept any values less than 5 or greater than 100. If the values are out of range, do not change the values of the fields. setHoursWorked( ) do data validation, do not accept any value less than 0 or greater than 80. If the parameter value is invalid, do not change the value of the fields, get( ) methods for each of the fields (except the constants) and a toString( ) method that will be called in the Driver class.

Driver class: This class will have no fields, only local variables in the main( ) method. It will have the main( ) method. The main( ) method will create an instance of PayCheck class using the default constructor.

Then, in a loop: Provide a menu that allows the user to enter any of the following: Prompt the user for a last name, and first name. Prompt the user to enter hours worked and hourly pay rate. Call the appropriate set ( ) methods depending on what the user decided to change. In each iteration of the loop, use the toString( ) method of the PayCheck class to display: Last Name, First Name, Gross Pay, Federal Tax, State Tax, FICA, Net Pay.

Loop until the user decides to not change any more employee information. If the code does not compile and run from main( ) a grade of zero is assigned. You will be graded based on completion of all the methods specified above, the correct instance creation in main( ), the display and use of a menu in main( ), the correct print statement that calls the toString( ) method.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions

Question

who has ip : host, interface, server and router?

Answered: 1 week ago