I have an upcoming lab assignment that I am trying to get an early start on, but I am having trouble finding help on the Internet. Basically, the assignment is this:
ASSIGNMENT:
Your program for this lab exercise will create a vertical bar chart of some
number of integer values. The program will ask the user how many values they
will enter (between 1 and 20, inclusive) and then will prompt the user to
enter each value (between 0 and 10, inclusive). After all of the data is
entered then the program will create a vertical bar chart using "*"
characters.
This is an example run of how your program should work
----------------------------------------------------------------------
How many values will you enter: 8
Enter a number between 0 and 10 (inclusive):1
Enter a number between 0 and 10 (inclusive):2
Enter a number between 0 and 10 (inclusive):4
Enter a number between 0 and 10 (inclusive):0
Enter a number between 0 and 10 (inclusive):10
Enter a number between 0 and 10 (inclusive):7
Enter a number between 0 and 10 (inclusive):-1
Invalid value. Try again.
Enter a number between 0 and 10 (inclusive):8
Enter a number between 0 and 10 (inclusive):3
Feel free to use as many classes as you want with this program. Think about
object oriented design and what sorts of classes you would want. There are
multiple ways to design this but one possibility is that you have a class
DataSet that contains the data and another class BarCharter that is a class
that knows how to print a vertical bar chart given a DataSet.
If anyone has code they can offer that can pull this off, please let me know.
I have my own set of code right here, but as you can see, I hadn't even found out how to do the graph part:
#include <iostream>
#include <cmath>
#include <string>
using namespace std;