Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions

Question

Dont off er e-mail communication if you arent going to respond.

Answered: 1 week ago

Question

1. What are digital media?

Answered: 1 week ago