**Designing a Payroll Program** Suppose you are to design a payroll program where the user inputs the employee’s name, number of hours worked, hourly pay rate, federal tax rate, and state tax rate. The program then prints a summary of the employee’s paycheck. Below are two sample runs, followed by detailed instructions to guide you. ### Sample Run 1 - **Employee Name:** Smith - **Hours Worked:** 10 - **Pay Rate:** $9.75 - **Gross Pay:** $97.50 - **Deductions:** - **Federal Withholding (20.00%):** $19.50 - **State Withholding (9.00%):** $8.78 - **Total Deduction:** $28.28 - **Net Pay:** $69.23 ### Sample Run 2 - **Employee Name:** John - **Hours Worked:** 40 - **Pay Rate:** $12.50 - **Gross Pay:** $500.00 - **Deductions:** - **Federal Withholding (15.00%):** $75.00 - **State Withholding (8.00%):** $40.00 - **Total Deduction:** $115.00 - **Net Pay:** $385.00 ### Instructions: - **Input Handling:** - Prompt the user for 5 different values and read inputs using a Scanner. - Use `.nextLine()` for the employee's name. - Use `.nextDouble()` for all numeric inputs. - **Calculations:** 1. **Gross Pay:** Calculate by multiplying `hours worked` by `hourly pay rate`. 2. **Federal Withholding:** Multiply `Gross Pay` by `federal tax withholding rate`. 3. **State Withholding:** Multiply `Gross Pay` by `state tax withholding rate`. 4. **Total Deduction:** Sum of `Federal withholding` and `State withholding`. 5. **Net Pay:** Subtract `Total Deduction` from `Gross Pay`. - **Output Formatting:** - Ensure output matches the sample format (use `printf` only). - Display two decimal places and the dollar symbol. - Indent the deductions list (use `\t`). - State and federal withholding rates should display the percentage
**Designing a Payroll Program** Suppose you are to design a payroll program where the user inputs the employee’s name, number of hours worked, hourly pay rate, federal tax rate, and state tax rate. The program then prints a summary of the employee’s paycheck. Below are two sample runs, followed by detailed instructions to guide you. ### Sample Run 1 - **Employee Name:** Smith - **Hours Worked:** 10 - **Pay Rate:** $9.75 - **Gross Pay:** $97.50 - **Deductions:** - **Federal Withholding (20.00%):** $19.50 - **State Withholding (9.00%):** $8.78 - **Total Deduction:** $28.28 - **Net Pay:** $69.23 ### Sample Run 2 - **Employee Name:** John - **Hours Worked:** 40 - **Pay Rate:** $12.50 - **Gross Pay:** $500.00 - **Deductions:** - **Federal Withholding (15.00%):** $75.00 - **State Withholding (8.00%):** $40.00 - **Total Deduction:** $115.00 - **Net Pay:** $385.00 ### Instructions: - **Input Handling:** - Prompt the user for 5 different values and read inputs using a Scanner. - Use `.nextLine()` for the employee's name. - Use `.nextDouble()` for all numeric inputs. - **Calculations:** 1. **Gross Pay:** Calculate by multiplying `hours worked` by `hourly pay rate`. 2. **Federal Withholding:** Multiply `Gross Pay` by `federal tax withholding rate`. 3. **State Withholding:** Multiply `Gross Pay` by `state tax withholding rate`. 4. **Total Deduction:** Sum of `Federal withholding` and `State withholding`. 5. **Net Pay:** Subtract `Total Deduction` from `Gross Pay`. - **Output Formatting:** - Ensure output matches the sample format (use `printf` only). - Display two decimal places and the dollar symbol. - Indent the deductions list (use `\t`). - State and federal withholding rates should display the percentage
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question

Transcribed Image Text:**Designing a Payroll Program**
Suppose you are to design a payroll program where the user inputs the employee’s name, number of hours worked, hourly pay rate, federal tax rate, and state tax rate. The program then prints a summary of the employee’s paycheck. Below are two sample runs, followed by detailed instructions to guide you.
### Sample Run 1
- **Employee Name:** Smith
- **Hours Worked:** 10
- **Pay Rate:** $9.75
- **Gross Pay:** $97.50
- **Deductions:**
- **Federal Withholding (20.00%):** $19.50
- **State Withholding (9.00%):** $8.78
- **Total Deduction:** $28.28
- **Net Pay:** $69.23
### Sample Run 2
- **Employee Name:** John
- **Hours Worked:** 40
- **Pay Rate:** $12.50
- **Gross Pay:** $500.00
- **Deductions:**
- **Federal Withholding (15.00%):** $75.00
- **State Withholding (8.00%):** $40.00
- **Total Deduction:** $115.00
- **Net Pay:** $385.00
### Instructions:
- **Input Handling:**
- Prompt the user for 5 different values and read inputs using a Scanner.
- Use `.nextLine()` for the employee's name.
- Use `.nextDouble()` for all numeric inputs.
- **Calculations:**
1. **Gross Pay:** Calculate by multiplying `hours worked` by `hourly pay rate`.
2. **Federal Withholding:** Multiply `Gross Pay` by `federal tax withholding rate`.
3. **State Withholding:** Multiply `Gross Pay` by `state tax withholding rate`.
4. **Total Deduction:** Sum of `Federal withholding` and `State withholding`.
5. **Net Pay:** Subtract `Total Deduction` from `Gross Pay`.
- **Output Formatting:**
- Ensure output matches the sample format (use `printf` only).
- Display two decimal places and the dollar symbol.
- Indent the deductions list (use `\t`).
- State and federal withholding rates should display the percentage
AI-Generated Solution
Unlock instant AI solutions
Tap the button
to generate a solution
Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education