Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

This is a C# program.....can you help me with this

Jul 22, 2010 11:25AM PDT

-This is the question:

An hourly employee is paid at a rate of $9.73 per hour for up to 40 hoursworked per week. From the worker's gross pay, 6% is withheld for social security tax, 14% is withheld for federal income tax, 5% is withheld for state income tax, and $6 per week is withheld for union dues. Write a program that takes as input the numberof hours workedin a week outputs the worker's gross pay, each withholding, and the net take-home pay for the week.

>Please help me with this....thank you

Discussion is locked

- Collapse -
Help with C sharp ?
Jul 22, 2010 1:34PM PDT

OK. But do your part first... Start off the program... or try to write the complete program... we help by making suggestions and ideas for you to correct the mistakes. We certainly will not write the program for you.

- Collapse -
C+ ??
Jul 23, 2010 6:51AM PDT

I'm with Papa here.

I assume you mean C+ or C++. Which ever, if this is a test you have to complete, or a project, then we will not help you. If you are having problems understanding, then the tutor who set the test or project will give you guidance.

I would say this. Personally I wouldn't even use C+ for this. It's perfect for Excel spreadsheet calculations.

Mark

- Collapse -
This is a C# program........can you help me with this
Aug 23, 2010 1:02PM PDT

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SampleProgram
{
class Program
{
static void Main(string[] args)
{
int hours;
double sst = 0.06d, fit = .14d, sit = 0.05d, ud = 6d, gross, rate = 9.73;
Console.Write("Enter Working hours:");
hours = int.Parse(Console.ReadLine());
gross = hours * rate;
Console.WriteLine("Net-take home pay:{0}", gross);
sst = gross * rate - 0.06d;
Console.WriteLine("Social Security Tax:{0}", sst);
fit = gross * rate - .14d;
Console.WriteLine("Federal Income Tax:{0}", fit);
sit = gross * rate - 0.05d;
Console.WriteLine("State Income Tax:{0}", sit);
ud = hours * rate - 6d;
Console.WriteLine("Union dues:{0}", ud);
}
}
}

-> This is the program code need a help if you know about this, my only point is to get the gross and subtract it with all of the withholding taxes and get the net take-home pay

- Collapse -
Re: help with program
Aug 23, 2010 5:35PM PDT

1. You don't tell what's wrong with this program. How to expect help then with correcting the error?
2. This is a typical homework assignment for a course in a school or so. We don't help with homework. That's something you should do yourself.

Kees