Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!