Hi, i have a lot of errors on this and am not sure how to fix it. This needs to be turned in in 2 hours so all help is needed =)).
Description: Design and implement an application that creates a histogram that allows you to visually inspect the frequency distribution of a set of values. The program should read in an arbitrary number of integers that are in the range 1 – 100 inclusive, then produce a chart similar to the one below that indicates how many input values fell in the range of 1 to 10, 11 – 20, and so on. Print one asterisk for each value entered. After the histogram has been displayed, allow the user to clear the screen and create another one as many times as he wishes.
1 – 10 | **************************
11 – 20 | ***
21 – 30 |******
31 – 40 |**
41 – 50 |*
51 – 60 |
61 – 70 |************************************
71 – 80 |***
81 – 90 |****************
91 – 100 | **
MY CODE IS HERE.
#include <iostream>
#include <iomanip>
using namespace std;
//local variables
int data = 0;
/**************************start main program*********************/
int main()
{
int arraySize[15] ;
int array[arraySize] = 0;
cout<<"Enter a list of numbers: ";
cin >> data ;
//Determine what range the number entered is in
if (data =>1 && data <10) {array[0]++; };
else if (data =>11 && data <20) {array[1]++; };
else if (data =>21 && data <30) {array[2]++; };
else if (data =>31 && data <40) {array[3]++; };
else if (data =>41 && data <50) {array[4]++; };
else if (data =>51 && data <60) {array[5]++; };
else if (data =>61 && data <70) {array[6]++; };
else if (data =>71 && data <80) {array[7]++; };
else if (data =>81 && data <90) {array[8]++; };
else if (data =>91 && data <100) {array[9]++;};
else break;
}
//Display screen
cout << "1-10: ";
cout << "11-20: ";
cout << "21-30: ";
cout << "31-40: ";
cout << "41-50: ";
cout << "51-60: ";
cout << "61-70: ";
cout << "71-80: ";
cout << "81-90: ";
cout << "91-100: ";
for (i=0;i<array[j];i++) {cout << "*"; };
if anyone can touch it up and lemme know where i went wrong i would greatly appreciate it, tried to contact teacher but no luck. thank you.