### For count help.

I'm not sure how to use the for command in this instance. The pseudo code says "for count = 1-12", but I'm not sure how to translate that into syntax. I would ask my professor, but it's way too late to call. Please help, I don't even care if you mock me and call me names. I CAN TAKE IT.

 ``123456789101112131415161718192021222324252627282930313233`` `````` #include #include using namespace std; int main() { //Variable Declarations int acctNum = 0; string firstName = ""; string lastName = ""; int purchasePrice = 0; int payment = 0; //Housekeeping cout << "Please enter account number: "; cin >> acctNum; cout << "Please enter customer's first name: "; cin >> firstName; cout << "Please enter customer's last name: "; cin >> lastName; cout << "Please enter purchase price: "; cin >> purchasePrice; //detail loop payment = purchasePrice / 12; cout << "Customer First Name: " << firstName; cout << "Customer Last Name: " << lastName; cout << "Account Number: " << acctNum; for(count = 0; count < payment; count++) { cout << "Payment Number " << count << ": \$" << payment << end1; } }``````
 ``12345`` ``````for (int i =1; i <=12; i++) { //do whatever } ``````
The normal idiom for doing something a set number of times is:

 `` `` ``for (int a = 0; a < 12; ++a) {}``

But magic numbers are not a good idea, so use a const variable instead:

 ``12345`` ``````const int MaxNumPayments = 12; for (int a = 0; a < MaxNumPayments; ++a){ // do whatever }``````

Reason for starting at zero is because arrays start at zero, getting used to doing it this way won't cause you any errors when you come to using arrays. Subscripting for other things start at zero also.

Whenever I see this: `for (int i =1; i <=12; i++)`, I am immediately suspicious.

@LivinLikeLarry

Also, were you meant to use `int` for the money values? `double` would be be better.