Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Find the maximum and minimum values, calculate the relative values as a percentage, display each rectangle by multiplying the screen height of the rectangle taken as 100% by the percentage.
If in the console, then you can display the character "\u2592" or asterisks, filling the height of each rectangle with them. A histogram can be drawn horizontally or vertically.
This is a difficult task for a beginner.
1. First you need to make a lexical analyzer that separates the text into tokens. Also, loops can be nested - a token within a token.
2. Here, and then, when you have a stream of tokens, you can count the corresponding tokens - get an array of quantities.
3. When you have an array of quantities, you can pass it to the histogram builder.
Building a histogram is the easiest part of this whole task.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question