Create an array of size 7 of integers1, -9, 10, 20, 5, 6, 7 . You can set these numbers in the code with initialization. (10 points)•Write a function that accepts anarray and returns the location/index of any value passed to the function. Test it with value 20 and value -1 (20 points) *HELP: this is linear search•Test it with value 7and write code in your “main” to see if it is the last element in the arra

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter12: Points, Classes, Virtual Functions And Abstract Classes
Section: Chapter Questions
Problem 29SA
icon
Related questions
Question

Create an array of size 7 of integers1, -9, 10, 20, 5, 6, 7 . You can set these numbers in the code with initialization. (10 points)•Write a function that accepts anarray and returns the location/index of any value passed to the function. Test it with value 20 and value -1 (20 points) *HELP: this is linear search•Test it with value 7and write code in your “main” to see if it is the last element in the array 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning