GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 13-Nov-2008, 04:28
dinamit875 dinamit875 is offline
New Member
 
Join Date: Oct 2008
Posts: 4
dinamit875 is on a distinguished road

random access files!


hi there! Im trying to write a program with random access files used in it!I have a structs setted up,what should i do next?

thats is the guidelines to the program:


The system should be set up so as to write to, read from and update records at given locations in a random access file using fixed length records.
It will consist of 2 files: Customer and the Transaction file
The customer information stored should include a customer id, first name, surname and list of accounts.
The accounts may be current accounts or deposit accounts. The current account has no interest rate while a deposit account has an interest rate and the interest is earned at the end of the financial year.
Note there will be a different set of transactions for each account
When a withdrawal or a deposit occurs, a transaction takes place.
Information stored on each transaction includes a transaction id (starts at 1 and increments accordingly), the account number , a transaction date, a description, an amount,
a transaction type( whether W (withdrawal) or D(deposit) ) and a balance.
The transaction type is used to place the amount in the correct column for debits or credits when writing a statement
This assumes there is only one transaction per day.
Making a deposit
The transaction id is set up using the transaction number stored within the account
The transaction type is ‘D’
The description, the amount and the balance are set accordingly
Similarly making a withdrawal
Writing a statement Print a statement for a given month
Write the customers account number, name and address
Print the transactions for this given month
setting out
trans id | trans date | description | credit | debit | balance

CPP / C++ / C Code:
#include <iomanip>
#include <string>
#include <cstring>
#include <stdlib>
#include <stdio.h>
#include <string.h>

using namespace std;

 struct custumer
 {
        int custumerId;
        int accountList;
        string custumerName;
        string custumerSurname;       
        string custumerAddress;
 };
 typedef struct custumer C;
 
 struct accounts
 {
        int accountNumber;
        string accountType;
 };
 typedef struct account A;
 
 struct transaction
 {
        int transactionId;
        int accountNumber;
        float amount;
        float balance;
        string transactionDate;
        string description[35];       
        string transactionType;       
 };
 typedef struct T;
do i have to set up a main(void) menu?Im workin on it,just need some help.,Thanks very much.
 
 

Recent GIDBlogAccepted for Ph.D. program by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Random access files RonR .NET Forum 0 25-Nov-2007 13:17
Random access files Krazy_yA C Programming Language 6 07-May-2006 02:44
access remote files in an application kris82 Apache Web Server Forum 1 06-Feb-2006 16:00
Apache2 config issues monev Apache Web Server Forum 2 28-Jun-2004 07:19
Can't view pages from another machine on the Intranet aevans Apache Web Server Forum 9 14-May-2004 03:26

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 14:44.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.