Question: The code I have is like this: #include #include #include #include using namespace std; int main() { int i = 0; const int NUM_VALS =

 The code I have is like this: #include #include #include #include

The code I have is like this:

#include #include #include #include using namespace std;

int main() { int i = 0; const int NUM_VALS = 7; vector firstname(NUM_VALS); vector lastname(NUM_VALS); string searchval; for (i = 0; i > firstname.at(i); cin >> lastname.at(i); } cin >> searchval; for (i = 0; i

--------------------------

The results are all good except for this one:

2. Compare output:

Input:

John

Doe

Steve

Smith

Smith

Your output:

Smith

Expected output:

Steve

5.23 Day 15: Put Smallest First 5.24 Programming 5: Find First Name Students This content is controlled by your instructor, and is not zyBooks content. Direct questions or concerns about this content to your instructor. If you have any technical issues with the zyLab submission system, use the "Trouble with lab?" button at the bottom of the lab. This programming assignment will build on lab 7 As before you wi read in a list of first and last names (ending the list with a blank line This time, you wi read an additional last name. You wi need to write code to find the first name of the person with the last name read. (Assume for this test there will be only one). Print the first name for the person found. Example input and Output below: INPUT John Doe Steve Smith Smith OUTPUT Steve

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 Databases Questions!