![]() |
|
#1
|
|||
|
|||
Help in solving this C++ problem.....write a program tht can be used to calculate the federal tax. The tax calculated as follows: For single peopl, the standard exemption is $4000; for married people, the standard exemption is $7000. A person can also put up to 6% of his or her gross standard income in a pension plan. The tax rates are as follows: If the the taxable income is
1) Between $0 and $15000, the tax rate is 15% 2)between $1500 and $40000, the tax is $2250 plus 25% of the taxable income over $1500 3)Over $40,000, the tax is $8460 plus 35% of the taxable income over $40000 Prompt the user to enter the following information: 4)Martial status 5)If the marital status is "married", ask for the number of children under the age of 14 6)Gross salary(if the martial status is "married" and both spouses have income, enter the combined salary.) 7)percentage of gross income contributed to a pension fund. The program must consist of at leat the following functions: a) function getData: this function asks the user to enter the relevant data. b) function taxAmount: this function computes and returns the tax owned. To calculate the taxable income, subtract the sum of the standard exemption, the amount contributed to a pension plan, and the personal exemption, which is $1500 per person. i have this so far CPP / C++ / C Code:
|
|||
|
#2
|
||||
|
||||
|
you seem to be on the right track. I have only a few suggestions:
1) instead of having or statements in all of your if statements you could use the toupper(string) function. What this does is convert whatever string you input to all uppercase letters. The return value is the uppercase string. (I myself just learned this one thanks to WaltP). 2)In the getStatusData() function you need to ask the person if they would like to put any of thier money into a pension. Next you need to check that the pension is equal to or less then .06 * gross standard income. 3)You should also have a variable called standardExemption that will equal 7000 when they say they are married or 4000 when they say they are single. 4) CPP / C++ / C Code:
CPP / C++ / C Code:
5) To determine the tax rate simply use a switch statment. Hope this helps you out |
|
#3
|
|||
|
|||
giving error message????I cant figure out the error message its giving me on cin(state) it says no in message what does it mean????? and how can i fix it????
CPP / C++ / C Code:
|
|
#4
|
||||
|
||||
|
Quote:
Problem 1: CPP / C++ / C Code:
Problem 2: CPP / C++ / C Code:
2) you need a : after the case value, not after the case keyword. Problem 3: CPP / C++ / C Code:
a) 'Y'||'y' giving the value TRUE or FALSE -- TRUE or 1 in this case b) assign that 1 to answer c) if (TRUE) -- which the value of answer is, do the IF block I would suggest reading up on standard C/C++ syntax and forget the use of enum until you understand the basics. At this point you don't understand if, switch, case syntax yet. __________________
The 3 Laws of the Procrastination Society: 1) Never do today that which can be put off until tomorrow 2) Tomorrow never comes |
Recent GIDBlog
Not selected for officer school by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| C I/O problem | kelly80 | C Programming Language | 4 | 27-Apr-2004 20:15 |
| Another FX 5600 problem (but with details that might shed light on this) | BobDaDuck | Computer Hardware Forum | 2 | 16-Apr-2004 07:53 |
| problem with php5 cgi installation | fab13 | Apache Web Server Forum | 3 | 19-Nov-2003 09:11 |
| unwanted scrollbar problem | kelly001 | Web Design Forum | 3 | 24-Oct-2003 10:44 |
| join problem | zuzupus | MySQL / PHP Forum | 0 | 14-Aug-2003 05:11 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The