Two Sample Run: Enter employee's name: Smith Enter number of hours worked in a week: 10 Enter hourly pay rate: 9.75 Enter federal tax withholding rate: 0.2 Enter state tax withholding rate: .09 Enter employee's name: John Enter number of hours worked in a week: 40 Enter hourly pay rate: 12.50 Enter federal tax withholding rate: 0.15 Enter state tax withholding rate: .08 Employee Name: Smith Hours Worked: 10.00 Pay Rate: $9.75 Gross Pay: $97.50 Deductions: Employee Name: John Hours Worked: 40.00 Pay Rate: $12.50 Gross Pay: $500.00 Deductions: Federal withholding (20.00%): $19.50 State withholding (9.00%): $8.78 Total Deduction: $28.28 Federal Withholding (15.00%): $75.00 State withholding (8.00%): $40.00 Total Deduction: $115.00 Net Pay: $69.23 Net Pay: $385.00

Question

Assignment: Carefully read the instructions and write a program that reads the following information and prints a payroll statement.

Employee’s name (e.g., Smith)
Number of hours worked in a week (e.g., 10)
Hourly pay rate (e.g., 9.75)
Federal tax withholding rate (e.g., 20%)
State tax withholding rate (e.g., 9%)

In summary, design a program to
• Prompt user for 5 values and read the values using Scanner
o Use method .nextLine() to get the String for the name
o Use method .nextDouble() to get all other numeric values
• Calculating the Gross pay
o Gross pay = hours worked * hourly pay rate
• Calculating the Federal withholding
o Federal withholding = Gross pay * federal tax withholding rate
• Calculating the State withholding
o State withholding = Gross pay * state tax withholding rate
• Calculating the Total deduction
o Total deduction = Federal withholding + State withholding
• Calculating the Net Pay
o Net Pay = Gross pay – Total deduction
• Formatting the output same as the Sample run (Use ONLY printf)
o Correctly format 2 decimals and use $ (hint $%.2f)
o Indenting the under Deductions (hint \t)
o Printing % for state withholding and federal withholding rate

Please note the following requirements:
o A description of what the program does
• The computer must do all calculations. 
• Take a screenshot of the console output
for 2 Sample Runs, same as the sample run shown above.

Two Sample Run:
Enter employee's name: Smith
Enter number of hours worked in a week: 10
Enter hourly pay rate: 9.75
Enter federal tax withholding rate: 0.2
Enter state tax withholding rate: .09
Enter employee's name: John
Enter number of hours worked in a week: 40
Enter hourly pay rate: 12.50
Enter federal tax withholding rate: 0.15
Enter state tax withholding rate: .08
Employee Name: Smith
Hours Worked: 10.00
Pay Rate: $9.75
Gross Pay: $97.50
Deductions:
Employee Name: John
Hours Worked: 40.00
Pay Rate: $12.50
Gross Pay: $500.00
Deductions:
Federal withholding (20.00%): $19.50
State withholding (9.00%): $8.78
Total Deduction: $28.28
Federal Withholding (15.00%): $75.00
State withholding (8.00%): $40.00
Total Deduction: $115.00
Net Pay: $69.23
Net Pay: $385.00
Expand
Transcribed Image Text

Two Sample Run: Enter employee's name: Smith Enter number of hours worked in a week: 10 Enter hourly pay rate: 9.75 Enter federal tax withholding rate: 0.2 Enter state tax withholding rate: .09 Enter employee's name: John Enter number of hours worked in a week: 40 Enter hourly pay rate: 12.50 Enter federal tax withholding rate: 0.15 Enter state tax withholding rate: .08 Employee Name: Smith Hours Worked: 10.00 Pay Rate: $9.75 Gross Pay: $97.50 Deductions: Employee Name: John Hours Worked: 40.00 Pay Rate: $12.50 Gross Pay: $500.00 Deductions: Federal withholding (20.00%): $19.50 State withholding (9.00%): $8.78 Total Deduction: $28.28 Federal Withholding (15.00%): $75.00 State withholding (8.00%): $40.00 Total Deduction: $115.00 Net Pay: $69.23 Net Pay: $385.00

Expert Answer

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Engineering

Related Computer Engineering Q&A

Find answers to questions asked by students like you.

Q: Consider a 4-way set associative cache made up of 64-bit words. The number of words per line is 8 an...

A: Cache size:The cache size can be calculated using the following formula:

Q: How would I solve this problem in python language Grades a) Write a program that reads in the names ...

A: Program Instructions:Use the open() function to read from the file.Save the result o spilt() functio...

Q: Based on Program.Py below, develop a list of requirements that could have been used to create the or...

A: Requirements are statements or items that shall be used or that a system needs while writing a progr...

Q: 1. What is the output of the following code? public class Loopy {public static void main(String[] ar...

A: 1.Explanation for the given java code:In the class "Loopy", variable "x" is declared and initialized...

Q: Write a program called StudentTable that prints the below table. Use only print() orprintf(). DO NOT...

A: The program in Java would be using print and printf statements with formatting for left alignment of...

Q: this question is from fundamentals of logic. related to boolean algebra. I am unable to decipher the...

A: Click to see the answer

Q: Consider the sender A transmits 12 data packets to B using stop wait protocol. If every 3rd packet i...

A: Analysis:In stop and wait protocol, the data packets will be transmitted as follows:1, 2, 3, 3, 4, 5...

Q: • Create a Scanner (note which line the user inputs and presses enter)• Asks the user to enter the n...

A: The algorithm for the program would be as below:Prompt the user for the inputAccept the user inputCo...

Q: How Technology can help to develop more effective policy?  (Information technology in Global Economy...

A: Information technology:Information technology(IT) has become a very important part of every business...

Q: Write a program called HeadsOrTails, that lets the user guess whether the flip of a coinresults in h...

A: The following variables used:coin to hold the value of random flipcoinString to hold the text value ...

Q: Analyze the following code: Code 1: int number = 45;boolean even; if (number % 2 == 0) even = true;e...

A: Hey, since there are multiple questions posted, we will answer first question. If you want any speci...

Q: What is the complement of the function F X7+ (X+TZ)+7? a) (XF( Z)).Y b) (X+F Z).Y c) (+ Z))Y d) .T+Z...

A: Complement of the function:The computation of complement of the given function is provided below:

Q: Write a class, AgeMessages , which does the following:a. Ask the user to enter age using a Scannerb....

A: The algorithm for the program would be as below:Declare one float variable for accepting user inputP...

Q: Problem: Write a program that converts degrees from Celsius to Fahrenheit, using the formula:Degrees...

A: Since you have asked two separate questions and it was not clear which specific question you wanted ...

Q: For this program you need to use Eclipse. Carefully read the instructions and write a program that r...

A: The program has the following algorithm: In the main method do the following operations,Get the empl...

Q: rewrite the function F = (A ⊕ B) ⊕ C without the XOR operator, ⊕.

A: The XOR operator is defined as 1 ⊕ 1 = 0, 1 ⊕ 0 = 1, 0 ⊕ 1 = 1, and 0 ⊕ 0 = 0. As the output is true...

Q: Match the following 1) BRANCHING 2) AIRTHMATIC 3) DATA TRANSFER 4) CONTROL TRANSFER Note: Instructio...

A: TRAP:TRAP instruction changes the program counter to an operating system “service routine”.When TRAP...

Q: What is the equivalent 2's complement representation for -15 in 16-bit hexadecimal representation? a...

A: For representing –15 in 2’s complement notation following steps should be followed:Find the binary e...

Q: 2) Identify the errors in the following programs a) 3 errorspublic class Test {public static void ma...

A: Hey, since there are multiple questions posted, we will answer first question. If you want any speci...

Q: Consider the UDP header 12 03 00 OF 00 1E A3 10. What is the total length of the UDP? a) 32 bytes b)...

A: Consider the given:The given User Datagram Protocol header is “12 03 00 0F 00 1E A3 10”.

Q: Provide a functional block diagram for a concept for an autonomous transportation and/or delivery th...

A: Autonomous transportation is the evolution of transport where the vehicles are connected to create a...

Q: Imagine you’d like a contractor to build a software application for you that operates like Windows C...

A: Since there are multiple questions and no specification as to which question needs to be solved, her...

Q: prove algebraically(w'+x+y')(w+x'+y)(w+y'+z)(w+y'+z)=x'y'+wx+xyz+w'yzthe question is from fundamenta...

A: LHS = (w'+x+y')(w+x'+y)(w+y'+z)(w+y'+z)Applying idempotent law (A+A) = AWe get by dropping the last ...

Q: Hello, I am struggling to write a program in Python for a following problem: Write a file ( .py). In...

A: Solution:Given data,The python code to strips the first letters from all file names in a directory i...

Q: note which line the user inputs and presses enter• area = radius * radius * pi• volume = area * leng...

A: The algorithm for the program would be as below:Declare 4 float variables for accepting user input a...

Q: Write a program called KiloToPoundTable that prints the below table. Useprintf()and while statement....

A: A constant is defined for holding the conversion factor. printf function is used to format the print...

Q: 1.1 Show that the following sets satisfy the law of contradiction and law ofexcluded middle.X = {a, ...

A: The conditions for to satisfy the law of contradiction and the law of excluded middle are:

Q: I need help figuring out how to summarize the content and format of a written technical report.

A: While we are writing a technical report we need to figure out the following points.The title page of...

Q: What is the new sematic elements in HTML5? 111 <mark iv a. i and iv b. iand iii c. i, ii and iv d....

A: Out of the given options, the semantic elements of HTML5 are&lt;details&gt;&lt;nav&gt;&lt;mark&gt;He...

Q: public class TestAverage {public static void main(String[] args) {int test1, test2, test3, sum;Scann...

A: The objective of the program is to calculate the average, now since the variable which holds the ave...

Q: What is the CPU time if the number of instructions executed by the program is 500 cycles per instruc...

A: CPU time:The formula for computing the CPU time is provided below:

Q: Assume that a firm has already implemented a KMS system, as a manager, how do you ensure that learni...

A: The given case study describes the internal knowledge assets of the organization and details about t...

Q: Which of the following statements are true? In PC relative addressing mode, the PC and constant need...

A: In PC relative addressing mode, the effective or branch address is obtained by adding offset to PC t...

Q: Write a program in Eclipse that contains 2 methods, main and printLine.

A: Program plan: Import necessary packages.Define a class named “PrintCheck”.Define a method called “pr...

Q: Hello, How to create a function in Python that strips the first letters from all file names in a dir...

A: The given program can be implemented using following instructions:In the function StripFirstLetter()...

Q: What are the mantissa and exponent values if 6.75 is represented in 8-bit binary floating-point repr...

A: Conversion of decimal to 8-bit floating point representation:Step 1: Convert the integer part of the...

Q: WRITE A JAVA PROGRAM that perform the Insertion Sort, Bubble Sort, Merge Sort, and Quick Sort algori...

A: Program Instructions:Create four methods named insertionSort(), bubblesort(), mergesort() and quicks...

Q: how do I Write a String constant consisting of exactly 5 exclamation marks. in python language

A: String Constants: The string constant is nothing but the sequences of characters that is used as dat...

Q: “Performance” or “response time.” defines how fast an application presents an output once given an i...

A: Performance bottleneck:It is defined as a condition in a system which can cause delays or slow down ...

Q: Show the output of the following code: Explain brieflyint a = 6;int b = a++;System.out.println(a);Sy...

A: The Output of the given code is shown below along with the code. To run the given code, it is import...

Q: Identify the errors in the following program. 2 errorspublic class Test {public static void main(St...

A: The two errors in the given program are:The argument is passed in wrong order in the line nPrintln(5...

Q: Based on Program.Py below, define and describe a soft process (using a process model), which you wil...

A: Solution:Process model:The software process contains the four activities such as software specificat...

Q: Write a class, VoteAge, which does the following:a. Ask the user to enter their age (ex. XX)b. Get t...

A: The algorithm for the program would be as below:Declare one float variable for accepting user inputP...

Q: Why is binary search algorithm better than sequential search?

A: Sequential search algorithm involves visiting each and every element of the list of elements and see...

Q: Consider the client A sends the data of 12 bytes to the sender B using the UDP. What is the efficien...

A: Efficiency:In User Datagram Protocol (UDP), the formula for computing efficiency of the transmission...

Q: Do you think technologies like Big Data and Predictive Analytics in Marketing would have worked 10-1...

A: The technologies like Big Data would not have worked 10-15 years back as due to lack of large datase...

Q: how can I create comments in python?

A: In python, # character is used to start the single line comments. Place a hash symbol in front of a ...

Q: I need help with this problem I attatched the sample output Exempt You will be writing a program to ...

A: Program plan:Display the welcome statementGet the average value from the user and check the average ...

Q: What is the output of the following code? def test_func (*a) print (a[0]) test_func1,2,3,4) test fun...

A: Consider the given code:#Function definition test_func()def test_func(*a):    #Print the output    p...

Q: Based on a decision tree structure - what are three decisions that may be applicable to a project? w...

A: A decision tree is a supervised learning technique which acts as a decision support tool. It forms a...