Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program that uses a function to search a 2D vector of floats. The function will have 2 parameters: 1. A 2 dimensional

Write a C++ program that uses a function to search a 2D vector of floats.

The function will have 2 parameters:

1. A 2 dimensional vector of floats, v

2. The floating point number that you are searching for, item

The function will return a vector objects. Each object will contain the row and column of each instance where the item is found in the 2D vector.

If the vector does not contain the item that it is searched for, the vector returned will only have 1 object. Within this object, the value -1 will be stored in the row member. Output to the console screen a message indicating that the vector did not contain this item if this is the case.

The main function will:

1. Output the contents of the 2D vector

2. Output the item number that you are searching for

3. Call the function that will search the 2D vector

4. Output the locations of where the item can be found within the 2D vector or output a message indicating that the item is not located within the 2D vector.

Sample Run #1

image text in transcribed

Sample Run #2

image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Structure Of The Relational Database Model

Authors: Jan Paredaens ,Paul De Bra ,Marc Gyssens ,Dirk Van Gucht

1st Edition

3642699588, 978-3642699580

More Books

Students also viewed these Databases questions

Question

Use your voice effectively.

Answered: 1 week ago

Question

8. Design office space to facilitate interaction between employees.

Answered: 1 week ago