arrays.cpp - arrays.cpp EECS 183 Lab 5 Array exercises Travis Birgy tbirgy The purpose of this lab is to understand creating arrays We do this by

arrays.cpp - arrays.cpp EECS 183 Lab 5 Array exercises...

This preview shows page 1 - 2 out of 2 pages.

/** * arrays.cpp * * EECS 183 * Lab 5: Array exercises * * Travis Birgy * tbirgy * * The purpose of this lab is to understand creating arrays. We do this by * writing the function defiinitions for three functions which all utilize * arrays. */ #include <iostream> using namespace std; /** * Requires: size > 0 and size is the number of elements in array * Modifies: cout * Effects : Prints the elements in the given array, delimited by curly * braces and separated by commas. */ void print_array(const int array[], int size); /** * Requires: size > 0 and size is the number of elements in array * Modifies: array * Effects : Negates each element in array. */ void negate_all(int array[], int size); /** * Requires: size > 0 and size is the number of elements in array * Modifies: Nothing. * Effects : Returns true if the elements in array are in order from * smallest to largest, with duplicates allowed. */ bool is_sorted(const int array[], int size); /** * Requires: size > 0 and size is the number of elements in source * and target * Modifies: target * Effects : First, initializes all values in target to 0.
Image of page 1
Image of page 2

You've reached the end of your free preview.

Want to read both pages?

  • Fall '08
  • DORF
  • It

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture