I am currently working on a banking system that has 3 classes. customer, savingsAccount and transaction. I have created the 3 classes but am having problems with the saveAcnt object in the customer class. I need to link it with the savingsAccount class. Any help would be appreciated.
Also I should note that each class is located in its own header file and they are all #include'd in the main cpp program.
/*
savingsAccount.h
*/
#include <iostream>
using namespace std;
class savingsAccount
{
public:
void createAccnt(int, double, double);
void addDeposit(double);
void subWithdraw(double);
void addInterest();
private:
int accntNo;
double balance;
double iRate;
};
//Main program defines accountNo, bal and interest and then passes to createAccount
void savingsAccount::createAccnt(int accountNo, double bal, double interest)
{
accntNo = accountNo;
balance = bal;
iRate = interest;
}
/*transaction.h
*/
#include <iostream>
using namespace std;
class transaction
{
public:
void readRecords(ifstream);
//int findAccount(Customer[], int);
//void process(Customer[]);
private:
int accountNumber;
double amount;
char transType;
};
/*customer.h
*/
#include <iostream>
using namespace std;
//class savingsAccount;
class customer
{
public:
void createCust(string, string, int);
bool searchAccount(int);
void applyTrans(char, double);
void accessAccount(char);
private:
string name;
string address;
savingsAccount saveAccnt;
};
void customer::createCust(string custName, string custAddress, int custSavingsAccnt)
{
name = custName;
address = custAddress;
//saveAccnt = custSavingsAccnt;
}