Question
Using the variables shown below and counter-controlled loops write a set of C++ statements that print a histogram like the one shown below as an
Using the variables shown below and counter-controlled loops write a set of C++ statements that print a histogram like the one shown below as an example. To print the histogram, your program must print as many '*' as indicated by the values read from the file on consecutive rows using nested for loops. Assume that the values in the file are all valid within the range 1 through 10. The file has exactly seven (7) values. For example, if the content of the input file is: 4 2 6 9 3 10 5 The histogram should look: **** ** ****** ********* *** ********** ***** ifstream myInfile; myInfile.open("input.txt"); int x, y; // to control the loops int max; // value read from the file ?(C++ language please!!)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started