Module 6 - Lab - Arrays (Challenge Lab)

 Objective

Write a C++ program that performs various operations on arrays using user-defined functions.

 Requirements

Your program should include the following:

  1. A function that initializes an array with random integers between a specified range.

  2. A function that prints the elements of an array.

  3. A function that finds and returns the sum of the elements of an array.

  4. A function that finds and returns the maximum and minimum elements of an array.

  5. A function that sorts the elements of an array in ascending order using the bubble sort algorithm.

  6. The program should use the above functions to perform the following operations:

    • Initialize an array with random integers.

    • Print the elements of the array.

    • Find and print the sum of the elements of the array.

    • Find and print the maximum and minimum elements of the array.

    • Sort the elements of the array in ascending order.

    • Print the sorted array.

  7. The program should use appropriate variable names and comments to make your code clear and easy to read.

Deliverable

Upload the following:

  1. Full source code (.cpp file or .txt file)

  2. Screenshot of the Console with the code executing

COSC-1336 / ITSE-1302 Computer Science - Author: Dr. Kevin Roark