please could any one give me hints in this question

A popular method of displaying data is a Histogram. A histogram counts how many items of data fall in each of n equally sized intervals and displays the results as a bar chart in which each bar is proportional in length to the number of data items falling in that interval.
Write a program that generates n random integers in the range 0-99 (use the remainder to fix the interval from 0 to 99) and produces a Histogram from the data. Assume that we wish to count the number of numbers that lie in each of the intervals 0-9, 10-19, 20-29, ........., 90-99. This requires that we hold 10 counts, use an array to hold the 10 counts. Having calculated the interval counts draw the Histogram by printing each bar of the Histogram as an appropriately sized line of X's across the screen as below
0 - 9 16 XXXXXXXXXXXXXXXX
10 - 19 13 XXXXXXXXXXXXX
20 - 29 17 XXXXXXXXXXXXXXXXX
etc.

Recommended Answers

All 2 Replies

Do the assignment one small step at a time. First create an array of the desired numbers. Get that compiled working first, then post the code you have done.

My hint #1: Use a better title. Something like Creating a Date Histogram. Also, Read This

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.