9. Implement an array with values 1, 5, 14, 23, 45, 52, 58, 81, 82 91. a) Create a getindex( function which does a linear search upon the array for a specific value n. Return the index of n, or -1 ifn does not exist, b) Print the array. c) Search the array for the values 23, 58, 11, rint the reaults. Qutpur Examnle 15 14 23 45 52 58 71 82 91 Number 23 is located at index Number 58 As located at index C Number 11 i looated at index -1

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section: Chapter Questions
Problem 1PP: (Statistics) a. Write a C++ program that reads a list of double-precision grades from the keyboard...
icon
Related questions
Question
9. Implement an array with values 1, 5, 14, 23, 45, 52, 58, 81, 82 91.
a) Create a getindex( function which does a linear search upon the array for
a specific value n. Return the index of n, or -1 ifn does not exist,
b) Print the array.
c) Search the array for the values 23, 58, 11, rint the reaults.
Qutpur Examnle
15 14 23 45 52 58 71 82 91
Number 23 is located at index
Number 58 As located at index C
Number 11 i looated at index -1
Transcribed Image Text:9. Implement an array with values 1, 5, 14, 23, 45, 52, 58, 81, 82 91. a) Create a getindex( function which does a linear search upon the array for a specific value n. Return the index of n, or -1 ifn does not exist, b) Print the array. c) Search the array for the values 23, 58, 11, rint the reaults. Qutpur Examnle 15 14 23 45 52 58 71 82 91 Number 23 is located at index Number 58 As located at index C Number 11 i looated at index -1
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr