1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
|
#include <iostream>
#include <fstream>
using namespace std;
class SavingsAccount
{
public:
void setUpAccount(savingsAccount)
{
savingsAccount accnts[10] =
{{123456,0.0,0.05},
{246890,0.0,0.05},
{293567,0.0,0.05},
{337761,0.0,0.05},
{846579,0.0,0.05},
{917355,0.0,0.05},
{937568,0.0,0.05}};
}
void addDeposit(float, float)
{
float deposit;
float balance;
balance = (balance + deposit);
}
void subWithdraw(float)
{
float withdraw;
float balance;
balance = (balance - withdraw);
}
void addInterest()
{
intRate = line3;
}
float getBalance()
{
cout << balance << endl;
}
bool matchAccount(int)
{
while (accNo != accountNo)
return false;
}
private:
int accNo;
int balance;
float intRate;
};
class Customer
{
public:
void createCust(string, string, SavingsAccount)
{
cout << "This routine allows staff to enter new customer data." << endl;
cout << "Enter the customer details as follows:" << endl;
cout << "first name, last name [Return] address [Return] account number [Return]." << endl;
cin >> name;
cin >> address;
cin >> saveAcntNo;
}
bool searchAccounts(int)
{
while (accountNo != accNo)
return false;
}
void applyTrans(char, float)
{
switch(transType)
{
case 'C':
SavingsAccount::addDeposit();
break;
case 'D':
SavingsAccount::subWithdraw();
break;
case 'I':
SavingsAccount::addInterest();
break;
}
}
void accessAccount(char)
{
//statements;
};
private:
string name;
string address;
int saveAcntNo;
};
class Transaction
{
public:
void readRecord(ifstream)
{
float line1;
float line2;
char line3;
while ((inFile.line1) !/0)
{
inFile >> line1;
inFile >> line2;
inFile >> line3;
}
}
int findAccount(saveAcntNo, int)
{
if (accountNo == saveAcntNo)
Transaction::process()
else
(accountNo++; Transaction::findAccount());
}
void process(saveAcntNo)
{
//statements;
}
private:
int accountNo;
float amount;
char transType;
};
int main()
{
ifstream inFile;
inFile.open("trans.dat");
Customer.createCust();
system("pause");
}
|