![]() |
|
#1
|
|||
|
|||
Desperately need Help with writing a balance program.This is my current lab, and to be honest I don't know where to begin. Honestly a step by step deal would be really helpful if possible. I definately don't expect the answer, but I would like it if someone could give me the necessary knowledge to do this with. I'm just getting started in C++, so please give me an answer in lamans terms. Any help is much apprieciated.
Suppose you want to keep your bank transactions on your computer, and you'd rather keep the information as a simple text file that you can manipulate using C++ programs, rather than being slave to Excel or Quicken. You decide to use the following format for your bank transaction file: The first line will be the starting balance, and the last line will be -1. All other lines will contain transactions. There are three types of transactions: Deposits, checks and ATM withdrawals. Deposit lines are of the form: Year Month Day Amount The year, month and day are all integers, and the amount is a positive double. Check lines are of the form: Year Month Day Amount Number The year, month and day are all integers. The amount is a negative double and number is the check number, which is a positive integer. ATM withdrawal lines are of the form: Year Month Day Amount 0 The year, month and day are all integers, and the amount is a negative double. Your program is going to read input in the proper format, and emit a very simple processing of the output. In particular, it is going to print 12 lines of output: The starting balance. The ending balance. A blank line. The date of the first transaction. The date of the last transaction. A blank line. The number of deposits and total amount of deposits. The number of checks and total amount of checks. The number of ATM withdrawals and their total amount. A blank line. Your minimum balance during this period. Your maximum balance during this period. |
|||
|
#2
|
|||
|
|||
Re: Desperately need Help with writing a balance program.I think the first step you need to do is create a class that can represent your account. It will have several variables, some of which are collections (arrays, lists, etc). The next step would be to write a printing function for printing the contents of this class to the screen. Then, you should write a function to read a text file and convert it to an instance of this class. Here is a start:
CPP / C++ / C Code:
|
Recent GIDBlog
Once again, no time for hobbies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Equation solver | RazoR | C Programming Language | 3 | 18-May-2008 10:24 |
| Two-Tier data dissemination code installation problem | nidhibansal1984 | Computer Software Forum - Linux | 6 | 16-Sep-2007 11:13 |
| Text-Based Roulette Game | mfm1983 | C++ Forum | 5 | 29-Nov-2006 13:20 |
| BOOKEEPING program, HELP!! | yabud | C Programming Language | 10 | 17-Nov-2006 04:48 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The