Site hosted by Angelfire.com: Build your free website today!

Program *34* 

 

 


In this program you are demonstrating your knowledge upon the usage of arrays and functions.

 

The format is simple.  Define and call three (3) functions where you will:

  1. Store 25 random numbers in the array from 1 – 999.
  2. In function 2 you will calculate and return the average of the array of numbers.
  3. In the third you will calculate the number of items in the array that are above, below, and equal to the average.

In main( ), ask the user for a target number.  Search for the number and tell if the number was found or not.

 

Finally, print out the original list of numbers.

 

 

Example:

 

Average of array: 455

 

Distribution:

above: 13                               below: 12                   at average: 0

 

Enter target number: 450                 Search: NOT FOUND

 

List: {890,450,558,87,12,45,120,545,145,6,201,777,679,876,220,903,245, 289,307,320,467,690}

 

 

Be prepared to run the program again with 500 numbers

 

 

Commitment is what transforms a promise into reality.
It is the words that speak boldly of your intentions and the actions which speak louder than words.
It is making the time when there is none. Coming through time after time.
Commitment is the stuff character is made of.
It is the daily triumph of integrity over skepticism.

 
 


 (go c-c runners!!)