In earlier chapters you developed classes needed for Cost Is No Object—a car rental service that specializes in lending antique and luxury cars to clients on a short-term basis. The rental service produces computerized paychecks for its employees every week. Write a program that gets data for each of the following:
An employee ID number
A first name
A last name
A street address
A zip code
An hourly pay rate
Number of hours worked this week
An insurance plan code
Create an application that prompts the user for employee data; the application continues to accept data for new employees until the user enters 0 for an ID number to indicate the desire to quit. While the ID number is not zero, prompt the user for a value for each field in turn. Any time the user enters an invalid value, continue to reprompt the user for the same data. Continue with the next data item only when the previous item is valid, as follows:
An employee ID must be between 100 and 999 inclusive.
A zip code must not be greater than 99999.
An hourly pay rate must be between $6.00 and $25.00 inclusive.
The number of hours worked in a week cannot be negative or more than 70.
An insurance plan code must be 1 or 2.
When all the needed data has been entered correctly for an employee, display a copy of all the data fields for the employee as well as the following:
Gross pay, calculated as hours worked times pay rate
Income tax, which is calculated as 15% of the gross pay if the gross pay is $400 or less; otherwise, it is 20% of the gross pay
Insurance premium, which is $60 for insurance plan code 1 and $100 for insurance plan code 2
Net pay, which is calculated as gross pay minus income tax, minus insurance premium; if the net pay is negative (the employee did not earn enough to cover the tax and insurance), then the net pay should be $0
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more