![]() |
|
#1
|
|||
|
|||
HELP!!!! Input files/ if thenWuts good board?? I am a undergrad student that is taking c++ for my major. I am an electrical engineering major. This is my first time ever coming in contact with programming, the shit is so hard. Each time i sit down and try to read it, it look so crazy to me, i have this program due
The program displays the total income taxes that you must pay for 2005 or your refund in 2005 is determined as follows: Let total_tax = amount of taxes owed (you will calculate total_tax = federal tax + state tax + city tax). If total_tax is greater than the total amount of tax already taken from your salary (you will find these amounts from your input data), then you must pay additional taxes of total_tax minus the taxes already taken from your salary. If total_tax is less than the total amount of tax already taken from your salary then you will receive a refund equal to the difference between the taxes already taken from your salary and total_tax. Federal tax = 15.7% of your taxable income that is <= $25,000 + 25% of any of your taxable income above $25,000 where: taxable income = gross salary - (no. of dependents * $1,000) - (no. of deductions * $475) State tax = 10.3% of Federal tax unless Federal tax < $200 then State tax = 0. City Tax = 8.5% of State tax unless State tax <= $100 then City tax = 0. Input: the input data stream format is: type of datum meaning characters year (2005) characters social security number (9 characters) float gross salary float federal tax already taken from salary float state tax already taken from salary float city tax already taken from salary integer number of dependents integer number of deductions Create an external file named tax.txt. Name your input file taxdata and include the following statement in your program: taxdata.open(“tax.txt”);. Run your program twice, first with the following input data: 2005 949581726 26000.00 5000.00 495.00 258.00 4 6 and then with a set of your own data. I started the program, and i did the calculations by hand, but wut stumps me is the input file and the then if, how would i do the input file?? how do i put the # into the file correctly so that the program reads it correctly?? how would i incorporate the then if statment in my calculations? and how would i stop the user from using it if they put in a number that makes the value untrue? Please help i would greatly appreciate it thanks guys!! |
|||
Recent GIDBlog
Programming ebook direct download available by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Checking source codes of image, audio and video files | onauc | C Programming Language | 5 | 26-Feb-2005 22:47 |
| Using files for input | crystalattice | C++ Forum | 15 | 31-Aug-2004 19:53 |
| Can't view pages from another machine on the Intranet | aevans | Apache Web Server Forum | 9 | 14-May-2004 03:26 |
| IP tables | rogermark100 | C Programming Language | 6 | 18-Apr-2004 08:22 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The