![]() |
#2
wind978682020-07-12 19:39
|
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <cstring>
#include "account.h"
using namespace std;
int main()
{
//for(int i=0;i<2;i++);
ifstream cin("acc.txt");
char *type;unsigned int ac;float ba;
for(;cin>>type>>ac>>ba;){
cout<<type<<endl;
if(strcmp(type,"Savings")==0)
new Savings(ac,ba);
else if(strcmp(type,"Checking")==0)
new Checking(ac,ba);
else{
cout<<"error account type :"<<type<<endl;
exit(1);
}
}
Account *p=Account::First();
/* while(p!=NULL)
{
p->Display();
p=p->Next();
}*/
p->Display();
p=p->Next();
p->Display();
p=p->Next();
p->Display();
p=p->Next();
p->Display();
p=p->Next();
p->Display();
p=p->Next();
p->Display();
p=p->Next();
}