Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python progeaming this is a formatign a problem my code runs perfectly i just need it to look like this input Enter employee's name: employeeName

python progeaming this is a formatign a problem my code runs perfectly i just need it to look like this 

input

Enter employee's name: employeeName Enter number of hours worked in a week: 40 Enter hourly pay rate: 12.75 Enter federal tax withholding rate (ex. 0.12): 0.11 Enter state tax withholding rate (ex. 0.06): 0.07

output

 EmployeName PAY INFORMATION Pay Hours Worked: 40 Pay Rate: $ 12.75 Gross Pay: $ 510.00 Deductions Federal Withholding (11.0%): $ 56.10 State Withholding (7.0%): $ 35.70 Total Deduction: $ 91.80 Net Pay: $ 418.20
 what i have so far name = input("Enter Employee's name: ") hrs = int(input("Enter number of hours worked in week: ")) pay = float(input("Enter hourly pay rate: ")) fedTax = float(input("Enter federal tax withholding rate: ")) stateTax = float(input("Enter state tax withholding rate: ")) gross = hrs * pay fedDeduct = fedTax * gross stateDeduct = stateTax * gross totDeduct = fedDeduct + stateDeduct netPay = gross - totDeduct print("Employee name: " + name) print("Hours worked: ", hrs) print("Pay rate: $", pay) print("Gross pay: $", gross) print("Deductions: ") print("\tFederal withholding ({0:.2f}%): ".format(fedDeduct) + "${0:.2f}".format(fedDeduct)) print("\tState withholding ({0:.2f}%): ".format(stateDeduct) + "${0:.2f}".format(stateDeduct)) print("\tTotal deductions: $%.2f" % totDeduct) print("Net Pay: $", netPay) 

criteria

  1. The first 5 lines are asking for input from the user.
  2. Notice the form tax rates are entered compared to how they're displayed.
  3. Notice the alignment/formatting of the output
  4. Headings of sections are centered and spaces between sections
  5. Main output header is all capitalized
  6. Output numbers are right-aligned with decimals aligned
  7. Colons and $ signs are aligned on output
  8. No arithmetic calculations inside the print string (use variables)
  9. A single print statement is used for output

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

AWS Certified Database Study Guide Specialty DBS-C01 Exam

Authors: Matheus Arrais, Rene Martinez Bravet, Leonardo Ciccone, Angie Nobre Cocharero, Erika Kurauchi, Hugo Rozestraten

1st Edition

1119778956, 978-1119778950

More Books

Students also viewed these Databases questions

Question

How does selection differ from recruitment ?

Answered: 1 week ago