Question

In: Computer Science

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

Tony Johnbull estimated tax is $11411.08 based on a gross income of $53398.12

Solutions

Expert Solution

#include <stdio.h>
#include<string.h>
int main()
{
    char name[200];
    float gross,state,federal_tax,fdia_tax,state_tax,Estimated_tax;
    printf("Enter your name: ");
    gets(name);
    printf("Enter your gross income: ");
    scanf("%f",&gross);
    printf("Enter your state income tax rate: ");
    scanf("%f",&state);
    federal_tax=gross*(9.45*0.01);
    fdia_tax=gross*(7.65*0.01);
    state_tax=gross*(state*0.01);
    Estimated_tax=federal_tax+fdia_tax+state_tax;
    printf("%s estimated tax is $%.2f based on a gross income of $%.2f",name,Estimated_tax,gross);
    return 0;
}

The above code is the program written in C which asks the user to enter the name and then enter the float values of gross income and the float values of state income tax rate and the according to the given values we calculate the values federal_tax,fdia_tax,state_tax and the by adding them we calculate the Estimated_tax and the display the result as required in the program output.

SCREENSHOT OF THE OUTPUT :

Here is the output screenshot of the given program and the photo is pasted aabove.


Related Solutions

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...
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...
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...
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 that asks the user to enter the name of a file, and then...
Write a program that asks the user to enter the name of a file, and then asks the user to enter a character. The program should count and display the number of times that the specified character appears in the file. Use Notepad or another text editor to create a sample file that can be used to test the program. Sample Run java FileLetterCounter Enter file name: wc4↵ Enter character to count: 0↵ The character '0' appears in the file...
Write a C++ program that asks the user to enter the monthly costs for the following...
Write a C++ program that asks the user to enter the monthly costs for the following expenses incurred from operating your automobile: loan payment, insurance, gas, oil, tires, and maintenance. The program should then display the total monthly cost of these expenses, and a projected total annual cost of these expenses. Label each cost. The labels should be left aligned and have a column width of 30 characters. The cost should be aligned right and displayed with two decimal places...
Write a program that asks the user to enter the monthly costs for the following expenses...
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 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.
Write a program that asks the user to enter the monthly costs for the following expenses...
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. Using the following test data: 310.34 104.95 78.34 12.34 8.12 45.00 Your output should look like this: Enter the monthly loan payment amount: Enter the monthly cost of insurance:...
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...
Write a program that asks the user to enter a number. Display the following pattern by...
Write a program that asks the user to enter a number. Display the following pattern by writing lines of asterisks. The first line will have one asterisk, the next two, and so on, with each line having one more asterisk than the previous line, up to the number entered by the user.For example, if the user enters 5, the output would be: * *   * *   *   * *   *   *   * *   *   *   *   * short codes please
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT