Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program to search for the following names in the text: Makar Alexeevich Joseph Bazdeev Boris Drubetskoy Scan (read and search) the input

Write a C++ program to search for the following names in the text: Makar Alexeevich Joseph Bazdeev Boris Drubetskoy Scan (read and search) the input file a line at a time. For each occurrence of each name in an input line, print: The line number (first line is 1). The character position of the first letter of the first name (first position is 1). The name itself. Print the names in line number order. A name can be split across two consecutive lines. In that case, print the line number of the first name. If you find more than one name in a line, print the names in alphabetical order by last name. 2 You may assume that the names in the input file are always in the order of the first name followed by the last name. Between the first and last names, there is either a single space or a line break. If a name is split across two lines, the first name will be at the end of one line, although there may be one or two blanks between the last letter and the line break, and the last name will always be the first character of the next line. Strings and vectors You must use C++ strings and not the old C strings, and you must use vectors instead of arrays. Use the vector at method instead of indexing with [ and ]

expected output:

LINE POSITION NAME 19949 1 Boris Drubetskoy 21906 66 Makar Alexeevich 21953 2 Makar Alexeevich 22173 9 Boris Drubetskoy 23910 62 Boris Drubetskoy 23982 39 Boris Drubetskoy 24033 54 Boris Drubetskoy 29439 31 Boris Drubetskoy 29614 28 Boris Drubetskoy 33007 1 Boris Drubetskoy 41110 22 Boris Drubetskoy 46593 60 Joseph Bazdeev 46612 19 Joseph Bazdeev 46622 28 Makar Alexeevich 46626 18 Makar Alexeevich 46626 39 Joseph Bazdeev 46642 20 Joseph Bazdeev 46689 11 Makar Alexeevich 48300 11 Makar Alexeevich 48314 42 Makar Alexeevich 48317 10 Makar Alexeevich 48323 68 Makar Alexeevich 48326 38 Makar Alexeevich 48331 60 Makar Alexeevich 48336 13 Makar Alexeevich 48347 28 Makar Alexeevich 48407 53 Makar Alexeevich 48409 19 Makar Alexeevich 48415 8 Makar Alexeevich 48433 24 Makar Alexeevich 48435 1 Makar Alexeevich 48468 68 Makar Alexeevich

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

More Books

Students also viewed these Databases questions

Question

Explain walter's model of dividend policy.

Answered: 1 week ago

Question

2. Define identity.

Answered: 1 week ago

Question

1. Identify three communication approaches to identity.

Answered: 1 week ago

Question

4. Describe phases of majority identity development.

Answered: 1 week ago