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
|
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
using namespace std;
struct Date
{
int day, month, year;
};
struct Name
{
string First_name, Middle_name, Last_name;
};
class Customer
{
private:
Date birth_date;
Name name;
float Balance_saving;
float Balance_checking;
public:
void withdraw( float amount, int account_type);
void deposit (float amount, int account_type);
void check_balance( ); // print out the balance on screen
Customer();
Customer(Date birth_date, Name name, float initial_saving, float initial_checking);
};
int main ()
{
string input;
fstream dataFile("account.dat", ios::in);
if (dataFile)
{
getline(dataFile, input, '$');
while (dataFile)
{
cout << input << endl;
getline(dataFile, input, '$');
}
dataFile.close();
}
else
{
cout << "ERROR: Cannot open file.\n";
}
system("Pause");
return 0;
}
|