Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9125035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:42:28+00:00 2026-06-17T06:42:28+00:00

Write a program that calculates and displays the take-home pay for a commissioned sales

  • 0

Write a program that calculates and displays the take-home pay for a commissioned sales employee after deductions are taken. The employee receives 7% of his or her total sales as his or her gross pay. His or her federal tax rate is 18%. He or she contributes 10% to his or her retirement program and 6% to Social Security. Use the Processing Logic provided in Step 2 below as a guide. The program’s output should look something like this:

Enter weekly sales: 28,000
Total sales:    $28,000.00
Gross pay (7%): $1,960.00
Federal tax paid:   $352.80
Social security paid:   $117.60
Retirement contribution:    $196.00
Total deductions:   $666.40

Take home pay:  $1,293.60
Press any key to continue.

//Here is my Code, I am having trouble getting input

        //Declarations

        int weeklySales;
        double grossPay = weeklySales * .07;
        double fedTax = grossPay * .18;
        double retirement = grossPay * .1;
        double socSecurity = grossPay * .06;
        double totDeductions = socSecurity + retirement + fedTax;
        double takeHomePay = grossPay - totDeductions;

        //Promt user for Input
        System.Console.WriteLine("What is your weekly Sales?");
        weeklySales = Console.Read();
        System.Console.ReadLine();




         //Output Display
        System.Console.Write("\nYour Weekly Sale amount is :\t\t" + weeklySales+ "\n\nGross Pay:\t\t\t\t" + grossPay+ "\n\nFed Tax \t\t\t\t" + fedTax + "\n\nRetirement\t\t\t\t"+ retirement + "\n\nSocial Security:\t\t\t" + socSecurity + "\n\nTotal Deductions:\t\t\t" + totDeductions + "\n\nMaking your take home pay:\t\t" + takeHomePay);
        System.Console.ReadLine();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T06:42:29+00:00Added an answer on June 17, 2026 at 6:42 am

    Proper method:

    Int32 weeklySales = 0;
    
    while (weeklySales.Equals(0))
    {
        Console.WriteLine("What are your weekly sales?");
        String input = Console.ReadLine();
    
        try
        {
            weeklySales = Int32.Parse(input);
        }
        catch
        {
            Console.WriteLine("There is an error in your input, try again!");
        }
    }
    
    Double grossPay = weeklySales * .07;
    Double fedTax = grossPay * .18;
    Double retirement = grossPay * .1;
    Double socSecurity = grossPay * .06;
    Double totDeductions = socSecurity + retirement + fedTax;
    Double takeHomePay = grossPay - totDeductions;
    
    Console.Write("\nYour Weekly Sale amount is :" + weeklySales + "$\nGross Pay: " + grossPay + "$\nFed Tax: " + fedTax + "$\nRetirement: " + retirement + "$\nSocial Security: " + socSecurity + "$\nTotal Deductions: " + totDeductions + "$\nMaking your take home pay: " + takeHomePay + "$");
    Console.Read();
    

    Easy method:

    Console.WriteLine("What are your weekly sales?");
    
    try
    {
        Int32 weeklySales = Int32.Parse(Console.ReadLine());
    
        Double grossPay = weeklySales * .07;
        Double fedTax = grossPay * .18;
        Double retirement = grossPay * .1;
        Double socSecurity = grossPay * .06;
        Double totDeductions = socSecurity + retirement + fedTax;
        Double takeHomePay = grossPay - totDeductions;
    
        Console.Write("\nYour Weekly Sale amount is :" + weeklySales + "$\nGross Pay: " + grossPay + "$\nFed Tax: " + fedTax + "$\nRetirement: " + retirement + "$\nSocial Security: " + socSecurity + "$\nTotal Deductions: " + totDeductions + "$\nMaking your take home pay: " + takeHomePay + "$");
        Console.Read();
    }
    catch
    {
        Console.WriteLine("There is an error in input. Program will be terminated.");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write myself a program that calculates a function taken from a
I am trying to write a python program that calculates a histogram, given a
I'm willing to write program that after 5 sec shows text that was hidden
I want to write a program that would take a string, let's say Fox
I'm trying to write a program that will take text in a JTextField and
I am supposed to write a program that calculates the total floor space in
I'm trying to write a Java program that can take values and put them
I want to write a program that calculates a given math function (by the
Write a program that accepts an integer larger than 1 and calculates the sum
I am trying to write a program that will take the users input value

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.