Project 1: String Histogram A Histogram is a visual way of representing frequenc
ID: 3765308 • Letter: P
Question
Project 1: String Histogram
A Histogram is a visual way of representing frequency counts. Most computer programs that produce histograms show the output horizontally rather than vertically. The goal of this assignment is to create a class that produces histograms from string data using some of the string functions outlined above. The output will occur when the output operator is invoked as shown below.
Histogram
enum LETTER { A=1,B,C,D,E,F,G,H,I,J,K,L,M,N,O, P,Q,R,S,T,U,V,W,X,Y,Z };
void acceptString( string data );
void acceptCString( char * data );
void reset( );
ostream& operator<<( ostream& outs, const Histogram& h );
string my_DataSoFar;
int my_FrequencyCount[ 27 ];
void incrementFrequency( LETTER l );
Histogram h;
string s;
cout << "Enter Data:"
cin >> s;
h.acceptString( );
cout << h << endl;
h.reset( );
char * cstr = "Hello";
h.acceptCString( cstr );
cout << h << endl;
Enter Data: supercalifragilisticexpialadocious
A - 4 - ****
C - 3 - ***
D - 1 - *
E - 2 - **
F - 1 - *
G - 1 - *
I - 6 - ******
L - 3 - ***
O - 2 - **
P - 2 - **
R - 2 - **
S - 3 - ***
T - 1 - *
U - 2 - **
X - 1 - *
E - 1 - *
H - 1 - *
L - 2 - **
O - 1 - *
Histogram
Histogram( );enum LETTER { A=1,B,C,D,E,F,G,H,I,J,K,L,M,N,O, P,Q,R,S,T,U,V,W,X,Y,Z };
void acceptString( string data );
void acceptCString( char * data );
void reset( );
ostream& operator<<( ostream& outs, const Histogram& h );
string my_DataSoFar;
int my_FrequencyCount[ 27 ];
void incrementFrequency( LETTER l );
Histogram h;
string s;
cout << "Enter Data:"
cin >> s;
h.acceptString( );
cout << h << endl;
h.reset( );
char * cstr = "Hello";
h.acceptCString( cstr );
cout << h << endl;
Sample OutputEnter Data: supercalifragilisticexpialadocious
A - 4 - ****
C - 3 - ***
D - 1 - *
E - 2 - **
F - 1 - *
G - 1 - *
I - 6 - ******
L - 3 - ***
O - 2 - **
P - 2 - **
R - 2 - **
S - 3 - ***
T - 1 - *
U - 2 - **
X - 1 - *
E - 1 - *
H - 1 - *
L - 2 - **
O - 1 - *
Explanation / Answer
#include #include using std::cout; using std::endl; using std::setw; using std::cin; int main(void) { const int max = 10; int list[max] = { 0 }; cout > list[i]; } int largest = list[0]; for (int i = 1; iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.