Complete Program Include Include Using Namespace Std Prints Elements Vector Terminal One L Q37174280

Complete the Program.

#include <iostream>
#include <vector>
using namespace std;

/**
    Prints all elements in a vector to the terminalon one line with a
    space between each element.
    @param data The vector to print.
    @see lesson 10.3 for examples.
*/
void printVector(const vector<int>& data);

/**
    Return the index of the last element of thenumber 42.
    If not found return -1.
    @param data The vector to search.
    @return the index of the last number 42, -1 ifnot found.
    @see Lesson 10.3.2.
    Test cases:
    findLast42({42, 1, 42, A3}) => 2
    findLast42({0, 1, 2, 42, 4, 42}) => 5
    findLast42({0, 1, 2, 3}) => -1
*/
int findLast42(vector<int>& data);

/**
    Delete last element

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.