Question

In: Computer Science

Using Python Write a program that does the following in order: 1.     Asks the user to enter...

Using Python

Write a program that does the following in order:

1.     Asks the user to enter a name

2.     Asks the user to enter a number “gross income

3.     Asks the user to enter a number “state tax rate

4.     Calculates the “Federal Tax”, “FICA tax” and “State tax

5.     Calculates the “estimated tax” and round the value to 2 decimal places

6.     Prints values for “name”, “gross income” and “estimated tax

The program should contain three additional variables to store the Federal tax, FICA tax, State tax, gross income, and estimated tax.

Federal Tax = gross income * 9.45%

FICA Tax = gross income * 7.65%

State Tax = gross income * your state tax percent

Estimated Tax = Federal tax + FICA tax + State tax

NOTE: Percentages must be converted to decimal values, for example:

            15.9%=15.9*0.01=0.159

An example of the program’s input and output is shown below:

Enter your name: Belinda Patton

Enter your gross income: 53398.12

Enter your state income tax rate: 4.27

Belinda Patton’s estimated tax is $11411.08 based on a gross income of $53398.12

Solutions

Expert Solution

I WROTE THE CODE ALONG WITH THE COMMENTS

CODE:

#scan input.
name=input("Enter your name: ")
gross_income=float(input("Enter your gross income: "))
tax_rate=float(input("Enter your state income tax rate: "))

federal_tax=gross_income*(9.45*0.01) #calculate federal_tax
fica_tax=gross_income*(7.65*0.01) #calculate fica_tax
state_tax=gross_income*(tax_rate*0.01) #calculate state_tax

estimated_tax=federal_tax+fica_tax+state_tax //calculate estimated_tax

#print results
print(name+"'s estimated tax is ${:.2f}".format(estimated_tax)," based on a gross income of ${:.2f}".format(gross_income))

OUTPUT:

SCREENSHOT OF THE CODE:


Related Solutions

Write a program that does the following in order: 1. Asks the user to enter a...
Write a program that does the following in order: 1. Asks the user to enter a name 2. Asks the user to enter a number “gross income” 3. Asks the user to enter a number “state tax rate” 4. Calculates the “Federal Tax”, “FICA tax” and “State tax” 5. Calculates the “estimated tax” and round the value to 2 decimal places 6. Prints values for “name”, “gross income” and “estimated tax” The program should contain three additional variables to store...
Using Python write a program that does the following in order: 1. Ask user to enter...
Using Python write a program that does the following in order: 1. Ask user to enter a name 2. Ask the user to enter five numbers “amount1”, “amount2”, “amount3”, “amount4”, “amount5” 3. Calculate the sum of the numbers “amount1”, “amount2”, “amount3”, “amount4”, “amount5” 4. If the sum is greater than 0, print out the sum 5. If the sum is equal to zero, print out “Your account balance is zero” 6. If the sum is less than 0, print out...
Write a program in PYTHON, using a while loop, that asks the user to enter the...
Write a program in PYTHON, using a while loop, that asks the user to enter the amount that they have budgeted for the month. The program should then prompt the user to enter their expenses for the month. The program should keep a running total. Once the user has finished entering their expenses the program should then display if the user is over or under budget. The output should display the monthly budget, the total expenses and whether the user...
Write a Python program that asks the user to enter the monthly costs for the following...
Write a Python program that asks the user to enter the monthly costs for the following expenses incurred from operating his or her automobile: Loan payment Insurance Gas Oil Tires Maintenance Write a function that takes these six items as arguments and computes the total cost of these expenses. Write a main program that asks the user for these six items and calls your function. Print total monthly cost and the total annual cost for these expenses. Your function should...
In Python write a program that asks the user to enter the monthly costs for the...
In Python write a program that asks the user to enter the monthly costs for the following expenses incurred from operating his or her automobile: loan payment, insurance, gas, oil, tires, and maintenance the program should then display the total monthly cost of these expenses, and the total annual cost of these expenses. your program MUST have BOTH a main function AND a function named calcExpenses to calculate the expenses. DO NOT display the expenses inside of the calcExpenses function!!...
Write a C program that does the following: 1) Asks the user to enter an integer...
Write a C program that does the following: 1) Asks the user to enter an integer N 2) Asks the user to enter three words with at least N letters and at most 20 letters 3) Prints the first N letters from the first word 4) Prints the last N letters from the second word 5) Prints all letters in the odd position in the third word Output: Please enter an integer N: 3 Please enter a word with at...
(IN PYTHON) Write a program that asks the user repeatedly to enter a student's score or...
(IN PYTHON) Write a program that asks the user repeatedly to enter a student's score or enter -1 to stop. When finished entering all the scores, the program should display the number of scores entered, the sum of the scores, the mean, the lowest and the highest score. (IN PYTHON)
Write a program that does the following in order: 1. Ask user to enter a name...
Write a program that does the following in order: 1. Ask user to enter a name 2. Ask the user to enter five numbers “amount1”, “amount2”, “amount3”, “amount4”, “amount5” 3. Calculate the sum of the numbers “amount1”, “amount2”, “amount3”, “amount4”, “amount5” 4. If the sum is greater than 0, print out the sum 5. If the sum is equal to zero, print out “Your account balance is zero” 6. If the sum is less than 0, print out “Your account...
Please write in Python code please: Write a program that asks the user to enter 5...
Please write in Python code please: Write a program that asks the user to enter 5 test scores between 0 and 100. The program should display a letter grade for each score and the average test score. You will need to write the following functions, including main: calc_average – The function should accept a list of 5 test scores as an input argument, and return the average of the scores determine_grade – The function should accept a test score as...
PYTHON: Write a program that asks the user to enter a 10-character telephone number in the...
PYTHON: Write a program that asks the user to enter a 10-character telephone number in the format XXX-XXX-XXXX. The application should display the telephone number with any alphabetic characters that appeared in the original translated to their numeric equivalent. For example, if the user enters 555-GET-FOOD, the application should display 555-438-3663. This is my code, but I cannot figure out where to go from here. #set new number new_number = "" #split number split_num = phone.split("-") for char in split_num[1:2]:...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT