Could you help me to finish this code (C++)?

Write your question here.
Create a program that will generate a list of 200 random numbers (ranging from 1- 1000) and determine the medium, mode, and average of the list of numbers. Have the program display the original list and then display the list in ascending and descending order on the screen.

I'm stuck!

Put the code you need help with here.
#include <iostream>
#include <ctime>
#include <cstdlib>
#include<stdio.h>
#include<conio.h>
void getMedium(int, int[]);
void getMode(int);
double getAverage(int, int[]);
using namespace std;
int main()
{
srand((unsigned)time(0));
int random_integer;
int lowest=1, highest=1000;
int range=(highest-lowest)+1;

for(int index=0; index<200; index++)
{
random_integer = lowest+int(range*rand()/(RAND_MAX + 1.0));
cout <<random_integer<< endl;
}
return 0;
}
Well first of all, do you know about indenting and spacing? If not, it makes the code look a lot cleaner and makes it easier to read try it like this

[code]
#include <iostream>
#include <ctime>
#include <cstdlib>
#include<stdio.h>
#include<conio.h>

void getMedium(int, int[]);
void getMode(int);
double getAverage(int, int[]);
using namespace std;

int main()
{
srand((unsigned)time(0));
int random_integer;
int lowest=1, highest=1000;
int range=(highest-lowest)+1;

for(int index=0; index<200; index++)
{
random_integer = lowest+int(range*rand()/(RAND_MAX + 1.0));
cout <<random_integer<< endl;
}

return 0;
} [\code]

I don't know if you already knew about that and posting just screwed up the formatting, but just letting you know if you didn't. Also you need to tell the compiler what your functions do. you have your function prototypes, but you don't define them. Unless these are standard ones I don't know about or use.
Topic archived. No new replies allowed.