So I am a bit rusty in my programming skills and don't have any real world experience except for the college classes I have taken in the past. I am working on a program for a class but running into a snag;I cannot figure out how to use the value of a variable inside a `For` loop outside of the loop. Here is the code I am referencing:

```
#include "iostream"

using namespace std;

int want, have, need;
int counter = 0;

char response, cont;

int diff(int want, int have);

int main(){
cout << "Welcome!\n";
cout << "This program will help you reach your money saving goals!\n";
cout << "Would you like to use this program? (y/n)\n";
    cin >> response;
    while (response == 'y'){
        cout << "Please enter all amounts in whole dollars only!\n";
        cout << "Please enter the amount of money you would like to have saved: $";
        cin >> want;
        cout << "\nPlease enter the amount of money you currently have saved: $";
        cin >> have;
        if (have >= want){
            cout << "You have already reached or exceeded your goal, this program will not be able to help you!\n";
            system("Pause");
            return 0;
        }
        cout << "\nYou need to save $" << diff(want, have) << " more money to reach your goal!\n";
        cout << "Would you like me to help you with a savings plan?";
        cin >> cont;
        while (cont == 'y'){
            int menu;
            cout << "Please select from the following options: \n";
            cout << "1 - Daily Saving Plan\n";
            cout << "2 - Weekly Saving Plan\n";
            cout << "3 - Monthly Saving Plan\n";
            cout << "Enter the number associated with your choice: \n";
            cin >> menu;

            switch (menu){
                case 1: {
                    int daily;
                    cout << "You have chosen the Daily Savings Plan\n";
                    cout << "How much money can you save every day? $";
                    cin >> daily;
                    for (int x = daily; x < need; x++){
                        daily = daily + daily;
                        counter++;
                    }
                    cout << "\nIt will take you " << counter << " days to reach your goal!\n";
                    break;
                }
                case 2: {
                    int weekly;
                    cout << "You have chosen the Weekly Savings Plan\n";
                    cout << "How much money can you save every week? $";
                    cin >> weekly;
                    for (int x = weekly; x < need; x++){
                        counter++;
                    }
                    cout << "\nIt will take you " << counter << " weeks to meet your goal!\n";
                    break;
                }
                case 3: {
                    int monthly;
                    cout << "You have chosen the Monthly Savings Plan\n";
                    cout << "How much money can you save every month? $";
                    cin >> monthly;
                    for (int x = monthly; x < need; x++){
                        monthly = monthly + monthly;
                        counter++;
                    }
                    cout << "\nIt will take you " << counter << " months to reach your goal!\n";
                    break;

                }
                default: cout << "You made an invalid selection";

                    cout << "Would you like to look at a different saving plan? (y/n)\n";
                    cin >> cont;
            }
        }
    }
}

int diff(int want, int have){
return want - have;
}

```

So, when I run the program, everything runs ok, but the value of counter is always shown as "0" in the final `cout` statement. 

I understand why it is doing this, I think..and it's because of the "int counter = 0" declaration outside the loop, so I assume it goes back to that value after the loop exits. 

If I do not initiate the counter variable, I get an error, and if I declare the value inside the loop, I get an error trying to use it in the cout statement as I have above. 

I'm not even sure my for loop is structured correctly...basically I want it to add to itself the weekly variable, until the total of `x = need`. I also want to capture how many iterations it takes for that, then output it as the number of weeks. Hopefully that all makes sense; any and all help is appreciated.