Q:

Sales Bar Chart

this is a program that calculates sales for 5 stores,
and I am supposed to create a program that shows each of it's earning for today.
This is what I have so far:
#include <iostream>
using namespace std;

int main()
{
//stores 1-5 variables
int store1; int store2; int store3; int store4; int store5;
// calculations
int sale1; int sale2; int sale3; int sale4; int sale5;

int counter;

cout << "Please enter today's sales for store 1: " ;
cin  >> store1;
cout << "Please enter today's sales for store 2: " ;
cin  >> store2;
cout << "Please enter today's sales for store 3: " ;
cin  >> store3;
cout << "Please enter today's sales for store 4: " ;
cin  >> store4;
cout << "Please enter today's sales for store 5: " ;
cin  >> store5;

cout << endl << "Sales Bar Chart";
cout << endl << "Each asterisks (*) respresents $100" << endl;

sale1 = sale1 / 100;
sale2 = sale2 / 100;
sale3 = sale3 / 100;
sale4 = sale4 / 100;
sale5 = sale5 / 100;

cout << "Store 1: ";
    for ( counter = 0; counter < sale1; counter++)
            cout << '*';
    cout << endl << "Store 2: ";
    for ( counter = 0; counter < sale2; counter++)
            cout << '*';
    cout << endl << "Store 3: ";
    for ( counter = 0; counter < sale3; counter++)
            cout << '*';
    cout << endl << "Store 4: ";
    for ( counter = 0; counter < sale4; counter++)
            cout << '*';
    cout << endl << "Store 5: ";
    for ( counter = 0; counter < sale5; counter++)
            cout << '*';

    cin.get();
    cin.get();

My problem is that the program is suppose to output the sales like this
Enter today's sales for store 1 : 100
Enter today's sales for store 2 : 200
Enter today's sales for store 3 : 300
Enter today's sales for store 4 : 400
Enter today's sales for store 5 : 500

sales bar chart
each * represents $100
Store 1:*
Store 2:*
Store 3:*
Store 4:*
Store 5:*
however, my input just puts numerous amounts of asterisks like this
http://tinypic.com/view.php?pic=9h0wh2&s=8#.VHJjb4vF-QM
I have no idea what I did wrong. 

A:

Basically the problem here is just a typo/wrong name.
cout << "Please enter today's sales for store 1: " ;
cin  >> store1;

You input into store1 but then you don't use it when you do your calculation because you have:    
sale1 = sale1 / 100;
        ^^^^^
        oops?

You really should compile your code with all warnings enabled and pay attention to them. In this case you would most likely have received warnings about using variables that were not initialized. Get in the habit of doing this as it will help you a lot in the future.

