Image

Imagetransmogrify wrote in Imagecpp

c++ project

my assignment is to create a random number generator to fill aone dimensional array with 13 numbers. the numberws should have 3 digits - two before the decimal and one after the decimal point. after the array is filled, it should print out the list horizontally and vertically, using iomanip, setw(), etc.
then its supposed to find the average and print it out with one decimal place properly labeled, sort using a bubble sort and print out the sorted list in the same format as above, find the median, find the mode, and find the standard deviation.

here's what i have so far
help would be greatly appreciated


#include <iostream.h>
#include <iomanip.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
void main()
{
srand (time(NULL));
int i;
float array[13];

for (i=0; i<13; i++)
{array[i] = (100 + rand()%900)/10.0;
cout« setiosflags(ios::fixed)
« setiosflags(ios::showpoint)
« setprecision(1)
« setw(5) «array [i] «endl;
}
cout «endl;
for (i=0; i<13; i++)
{
array [i] = 100 + rand ()%900/10.0;
cout «setw (5) «array[i];
}
cout «endl;
}


p.s.- watch out for html auto-formatting if you post a reply
cross-posted in Imagecoders_haven