Question: Please complete the following C++ program using Visual Studio. There are three lab problems. solve for each of them separately and make sure it runs

Please complete the following C++ program using Visual Studio. There are three lab problems. solve for each of them separately and make sure it runs well. for Lab 3 just make sure the code has no error and I will run after I saved text file.

Lab Assignment 19 - Arrays

  1. Program a new program called Lab19A

Declare the array below in your program. Then, find and print the last odd integer in the array.

int array1 [ ] = {1, -2, -1, 2, 8, 9, -51, 6, 9, 24, 0, 2, -25};

2. Program a new program called Lab19B

  • Declare an array of 10 integers and set each value in the array equal to 5 times its index.
  • Print the array all on one line separated by spaces.
  • Add up all the array elements and print the total.

  1. Program a new program called Lab19C that searches for a number in an array.
    1. Include a void function with an int array as a parameter that reads the values from a text file (Lab19C.txt) and places the values in the array.
    2. Include a bool function that receives 3 parameters: an int array, the array length, and an int number. Return true if the number is in the array and false otherwise.
    3. In the main function, declare an array of 20 integers.

Call the function to populate the array, and then print the array (on one line separated by spaces).

Ask the user for a number to search for in the array and call the function to search for it. Using the returned value print a statement to say if the number is found or not.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!