Colour Theme Font Size Options
 
 
 
Exercise 2

One Dimensional Arrays with Functions Exercise

Create a C++ program named ex2_arrayFunc.cpp in the Visual Studio project or create it in your IDE.

Your code will declare an integer array of size 10, then use three functions to individually do each of the following:

  • Ask the user to enter 10 numbers for the array
  • Print out the array (all the array elements)
  • Find the maximum value of the array and return it to be printed in main()

Test to see if your program will work with any integers, negative or positive, large or small.

When you are done:

  • Take a screenshot of your IDE and console window showing the g++ compile command and two runs with any integers, negative or positive, large or small.
  • For this exercise, you will have: ex2_arrayFunc.cpp.
  • Complete all the exercises in this lab and upload the .cpp files and the screenshots to URCourses.