Hello. I'm a new programmer and I need help or a hint with a homework assignment. I need to make a bar chart with asterisks that looks like this:
Store 1: ******
Store 2: ***
etc.
anyway, right now what I have is:
It's not displaying asterisks and I just need a little help. I'm a beginner and completelyCode:#include <iostream> #include <iomanip> using namespace std; int main () { const int STORES = 5; int sales[STORES], i; for (i = 0; i < STORES; i++) { cout << "Please enter today's sales for store " << i + 1 << ": $"; cin >> sales[i]; sales[i] /= 100; } for(int i = 0; i < 10; i++) { cout << "*"; cout << endl << endl; cout << "SALES BAR CHART" << endl; cout << "(Each * = $100)" << endl; cout << "Store 1: " << sales[0] << endl; cout << "Store 2: " << sales[1] << endl; cout << "Store 3: " << sales[2] << endl; cout << "Store 4: " << sales[3] << endl; cout << "Store 5: " << sales[4] << endl; return 0; } }
burnt out. I'm programming on xcode so it might look a little weird (?) works fine in visual studio though.


Reply With Quote
Bookmarks