Home > Back-end >  Said I "I" is not defined for help
Said I "I" is not defined for help

Time:09-26

# include "the h
"# 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; Char CMD.
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; iCout<" [" & lt; & lt; i<& lt; "] ";
The accounts [I] - & gt; Show ();
Cout}
break;
Case 'c' :
Cin> Day;
If (dayCout<" You always specify a previous day ";
Else if (dayCout<" Invalid 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; iThe accounts [I] - & gt; To settle (date);
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 a
Int index that day, I;

CodePudding user response:

You I is not defined for (I=0; i CodePudding user response:

I won't is as a taxi since ask thank you,
  • Related