Help with Arrays

This is a discussion on Help with Arrays within the C++ Programming forums, part of the General Programming Boards category; I need somewhere to start off with. Brief Description 1. In this assignment , you are to write a program ...

  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    18

    Help with Arrays

    I need somewhere to start off with.

    Brief Description
    1. In this assignment , you are to write a program that prints out the elements of an array of numbers and finds the aveages of those numbers. The array has as its element type int, and a size of 150.

    Design
    Your program must include these functions:
    [CODE]
    1. void intitalize (int [], int); which intializes the arrays elements to a random integer between 1 and 100.

    2. void print (int [], int); which prints out all of the array elements with 10 per line, anda spacing between the elements of 7.


    I need some help on where to start off at. A little bit of code on any of thes things. Thank you.


    Shawn

  2. #2
    vae victus! skorman00's Avatar
    Join Date
    Nov 2003
    Posts
    594
    initialize will just go through the entire array, and put in numbers one by one. You know how many elements are in the array, so bounds checking is cake.

    the second one is pretty self explanitory.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. pointers & arrays and realloc!
    By zesty in forum C Programming
    Replies: 14
    Last Post: 01-19-2008, 03:24 PM
  2. Replies: 16
    Last Post: 01-01-2008, 03:07 PM
  3. Need Help With 3 Parallel Arrays Selction Sort
    By slickwilly440 in forum C++ Programming
    Replies: 4
    Last Post: 11-19-2005, 09:47 PM
  4. Building B-Tree from Arrays
    By 0rion in forum C Programming
    Replies: 1
    Last Post: 04-09-2005, 02:34 AM
  5. Crazy memory problem with arrays
    By fusikon in forum C++ Programming
    Replies: 9
    Last Post: 01-15-2003, 08:24 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21