"# include
using namespace std;
Int main () {
The Date the Date (2008, 11, 1);
SavingsAccount sa1 (date, "S3755217", 0.015);
SavingsAccount sa2 (date, "02342342", 0.015);
CreditAccount ca (date, "C5392394", 10000, 0.0005, 50);
The Account * accounts []={& amp; Sa1, & amp; Sa2, & amp; Ca};
Const int n=sizeof (accounts)/sizeof (Account *);
Cout<" (d) deposit (w) withdraw (s) show (c) change day (n) next month (e) exit "& lt;
Do {
The date. The show ();
Cout<" \ tTotal: "& lt;
Int index, day;
Double the amount.
String desc;
Cin> CMD.
The switch (CMD) {
Case 'd' :
Cin> Index> The amount;
Getline (cin, desc);
The accounts [index] - & gt; Deposit (the date, amount, desc);
break;
Case 'w' :
Cin> Index> The amount;
Getline (cin, desc);
The accounts [index] - & gt; Withdraw (date, amount, desc);
break;
In case the 's' :
for(i=0; i
The accounts [I] - & gt; Show ();
Cout
break;
Case 'c' :
Cin> Day;
If (day
Else if (day
The else
Date=date (date. GetYear (), the date, getMonth (), day);
break;
Case 'n' :
If (date. GetMonth ()==12)
Date=date (the date getYear () + 1,1,1);
The else
Date=date (date. GetYear (), the date, getMonth () + 1, 1);
for(i=0; i
break;
}
} while (CMD!='e');
return 0;
}
CodePudding user response:
Can you post such a long code, but ask this question, a see will know that from a local copy of the code,CodePudding user response:
Int index, day; Here add the I variable declaration, that is, into aInt index that day, I;
CodePudding user response:
You I is not defined for (I=0; i