Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ code and please don't forget the screenshot of the working code Details Given a text file, the program execution outputs the lines that contain

C++ code and please don't forget the screenshot of the working code

Details

Given a text file, the program execution outputs the lines that contain a target word. Your implementation should be not case sensitive (that is your program ignores the difference between upper-cased and lower-cased letters.).

For example, given a line "Hello World!" and assuming the target word is "world", then this line should be output; if a line is "Hello worlds", then the line should NOT be output.

the program accepts two command-line parameters. The first parameter is the filename of the local text file that you want to read. The second one is the target word that you want to search.

Textfile:

 1870 ANNA KARENINA by Leo Tolstoy translated by Constance Garnett PART ONE Vengeance is mine; I will repay I. Happy families are all alike; every unhappy family is unhappy in its own way. Everything was in confusion in the Oblonskys' house. The wife had discovered that the husband was carrying on an intrigue with a French girl, who had been a governess in their family, and she had announced to her husband that she could not go on living in the same house with him. This position of affairs had now lasted two days, and not only the husband and wife themselves, but all the members of their family and the household, were painfully conscious of it. All the members of the family and the household felt that there was no sense in their living together, and that even stray people brought together by chance in any inn had more in common with one another than they, the members of the family and the household of the Oblonskys. The wife did not leave her own apartments; the husband had not been home for two days. The children ran wild all over the house; the English governess quarreled with the housekeeper, and wrote to a friend asking her to look out for a new employ for her; the man cook had walked off the day before just at dinnertime; the kitchenmaid and the coachman had given warning. Two days after the quarrel, Prince Stepan Arkadyevich Oblonsky- Stiva, as he was called in the fashionable world- woke up at his usual hour, that is, at eight o'clock in the morning, not in his wife's bedroom, but on the leather-covered sofa in his study. He turned over his stout, well-cared-for person on the springy sofa, as though he would sink into a long sleep again; he vigorously embraced the pillow on its other side and buried his face in it; but all at once he jumped up, sat up on the sofa, and opened his eyes. "Yes, yes, how was it now?" he thought, going over his dream. "Yes, how was it? Yes! Alabin was giving a dinner at Darmstadt; no, not Darmstadt, but something American. Yes, but then, Darmstadt was in America. Yes, Alabin was giving a dinner on glass tables, and the tables sang, Il mio tesoro- no, not Il mio tesoro, but something better, and there were some sort of little decanters on the table, and, at the same time, these decanters were women," he recalled.

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

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions