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

image text in transcribed

image text in transcribed

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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions

Question

Hinge

Answered: 1 week ago