97.4k views
0 votes
You found an exciting summer job for five weeks. It pays, say, $15.50 per hour. Suppose that the total tax you pay on your summer job income is 14%. After paying the taxes, you spend 10% of your net income to buy new clothes and other accessories for the next school year and 1% to buy school supplies. After buying clothes and school supplies, you use 25% of the remaining money to buy savings bonds. For each dollar you spend to buy savings bonds, your parents spend $0.50 to buy additional savings bonds for you. Write a program that prompts the user to enter the pay rate for an hour and the number of hours you worked each week.

User Kluddizz
by
4.9k points

1 Answer

5 votes

Answer:

Written in Python

hours = int(input("Hours Worked: "))

rate = int(input("Hourly Rate: "))

gross = hours * rate

net = gross * 0.14

gross = gross * 0.14

clothes = net * 0.10

school = net * 0.01

net = net - (clothes + school)

bonds = net * 0.25

parentsBonds = bonds * 0.50

print("Gross Income: $"+str(round(gross,2)))

print("Net Income: $"+str(round(net,2)))

print("Clothes & Accessories: $"+str(round(clothes,2)))

print("School Supplies: $"+str(round(school,2)))

print("Savings Bonds: $"+str(round(bonds,2)))

print("Parents Bonds: $"+str(round(parentsBonds,2)))

Step-by-step explanation:

This line prompts user for hours worked

hours = int(input("Hours Worked: "))

This line prompts user for hourly rate

rate = int(input("Hourly Rate: "))

This line calculates the gross pay before tax

gross = hours * rate

This line calculates the net pay before tax

net = gross * 0.14

This line calculates the net pay after tax

gross = gross * 0.14

This line calculates the amount spent on cloth

clothes = net * 0.10

This line calculates the amount spent on school

school = net * 0.01

This line calculates the net after spending on clothes and schools

net = net - (clothes + school)

This calculates the savings for bonds

bonds = net * 0.25

This calculates the support for bonds from parents

parentsBonds = bonds * 0.50

This prints the Gross Income

print("Gross Income: $"+str(round(gross,2)))

This prints the Net Income

print("Net Income: $"+str(round(net,2)))

This prints the Amount spent of clothes and accessories

print("Clothes & Accessories: $"+str(round(clothes,2)))

This prints the school supplies

print("School Supplies: $"+str(round(school,2)))

This prints the savings bond

print("Savings Bonds: $"+str(round(bonds,2)))

This prints the parents bonds

print("Parents Bonds: $"+str(round(parentsBonds,2)))

User Arthurfnsc
by
5.1k points