hey guys thanks for the reply and so the question is not clear I know. what I am trying to do is creat a graph in the console window and use vector index values as x and y corridinates. This is what I have so far after working on the problem for a while.
#include<iostream>
#include<vector>
#include<algorithm>
usingnamespace std;
int main()
{
cout<<"Enter positive whole numbers 1-15."<<endl;
vector <int> myvec;
int nums;
while(cin>>nums)
{
myvec.push_back(nums);
}
sort(myvec.begin(),myvec.end());
for(int i=0;i<myvec.size();++i)
{
cout<<myvec[i]<<" ";
}
if(myvec.size()%2==0)
{
cout<<endl<<((myvec[myvec.size()/2]+myvec[((myvec.size()-1)/2)])/2.0)<<endl;
}
else
{
cout<<endl<<myvec[((myvec.size()-1)/2)]<<endl;
}
cout<<"Here is the first and second index graphed."<<endl;
cout<<"y axis"<<endl;
for(int i=15;i>0;i=i-1)
{
cout<<i<<endl;
}
for(int i=1;i<myvec[0];++i)
{
cout<<" ";
}
cout<<"x"<<endl;
for(int i=1;i<myvec[1];++i)
{
cout<<"|"<<endl;
}
for(int i=0;i<16;++i)
{
cout<<i;
}
cout<<"x axis"<<endl;
This does not work in that the y axis does not properly display a numerically decrementing for loop starting at 15 and stopping at 1 other wise it does put x on the proper point on the graph any help to make it better