https://github.com/cgbur/console-histogram-java
Assignment 2 - Comp 210/390/401
https://github.com/cgbur/console-histogram-java
Last synced: about 2 months ago
JSON representation
Assignment 2 - Comp 210/390/401
- Host: GitHub
- URL: https://github.com/cgbur/console-histogram-java
- Owner: cgbur
- Created: 2020-01-16T00:04:58.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-16T03:32:09.000Z (almost 6 years ago)
- Last Synced: 2025-07-24T21:02:15.452Z (5 months ago)
- Language: Java
- Homepage:
- Size: 43 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Console Histogram
For the second assignment, you will get a chance to do some more programming in Java by implementing a histogram viewer. The input (specified below) will be fed into your program via standard input (stdin). Your program should then display a histogram of the data, rendered in the console. You can think of this kind of like a very basic form of ASCII art. You are encouraged to be creative in both your design of the program and the display of the histogram. Along with the histogram, you should also display the minimum, maximum, and mean. Feel free to display other relevant information or statistics along with the histogram.
### Program - Minimum Requirements
1. Read from stdin the specified input
2. Display a histogram of the data
3. Display minimum, maximum, and mean
4. Exit (program terminates once it has finished rendering i.e. does not wait for a key to be pressed)
### Project - Requirements
1. All `.java` files should be inside the `/src/` directory.
## Input Specification
Input will be fed to your program through standard in. Each item that is provided will be separated by a space. The input will always be provided in the following order.
1. The number of bins the histogram should have.
2. Each data point (space separated again).
You have been provided with a text file with the smaller data set below and also a large one that includes most NBA players. An example input is inside a file named `nba_heights_sample.txt` along with histograms of what the data should look like when plotted.
```
7 81 82 75 73 74 74 79 72 84 80 77 73 77 81 80 82 75 77 81 80 82 71 79 79 80 77 77 73 72 75 74 83 78 76 79 73 81 81 82 73 82 76
```
This histogram for this should resemble the following (note that since yours will be rendered in a console, it will not look exactly like this. You can use this as a reference for how you are progressing by comparing the bins and the height of the bars):
