Create a PlotNumbers class that has five data members to store five integer values from the user. It should have a 5-parameter constructor that can set the data members to the values provided as arguments, or a default value of 10. The class must also have a plot member function that uses a two-dimensional array to display the numbers as vertical bars. For example, the output for five numbers 2, 4, 3, 6, 3 would be
*
*
* *
* * * *
* * * * *
* * * * *
Write a client program that demonstrates the above class. It should plot two graphs, one for a PlotNumbers object created with default values, and another for the object that gets its five values from the user.
#include <iostream>
#include <string>
usingnamespace std;
class PlotNumbers
{
private:
int num1,num2,num3,num4,num5;
int plot(int rows[],int columns[]);
public:
PlotNumbers(int n1,int n2,int n3,int n4,int n5)
{
num1 = n1;
num2 = n2;
num3 = n3;
num4 = n4;
num5 = n5;
}
PlotNumbers()
{
int allnum = 10;
num1 = allnum;
num2 = allnum;
num3 = allnum;
num4 = allnum;
num5 = allnum;
}
};
int main()
{
int rows,columns;
cout << "Enter the number of rows" << endl;
cin >> rows;
I am confused now..abt how to have classes and arrays together.
THE STARS in the question are messed up.. it is supposed to be lined up as asked in the question