Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Lab Assignment The project is due in one week. Specifically, it is due by the midnight on the day of the next lab. Implement

C++ image text in transcribed

Lab Assignment The project is due in one week. Specifically, it is due by the midnight on the day of the next lab. Implement the lab using procedural programming techniques only. That is, you are not allowed to define classes or objects. Dift. Implement a program that compares two text files character-by-character. The program should output the line numbers that contain different characters and the place where the two lines start to differ (the difference is denoted by (caret) character. If both files are identical, the program should output nothing. File lengths may differ. If one file is shorter than the other, the shorter file is assumed to have empty lines, i.e. the extra lines of the longer file are considered different from the empty lines of the shorter file. The file names should be passed as arguments on the command line. Assume the files exist. Assume the file names are the same length. If your program is not invoked with two arguments, it should print an error message and quit. The program operation should look like this: prompts diff file.txt file2.txt filei.txt: 20: Hello file2.txt: 20: Hallo filei.txt: 25: World???? file2.txt: 25: World! where 20 and 25 are line numbers. You are allowed to use getline() and string comparison functions in the implementation of this project. Milestone. Code that inputs two lines from two different files and determines whether they are the same. Hint. The command line arguments are input as C-style strings arguments to main(). See this program for an example of handling them. To configure command-line arguments for an MS Visual Studio project, right-click Solution Explorer, select "properties" from the drop-down menu, go to Configuration Properties Debugging and set "Command Arguments" in the properties list. To create a string of spaces of a particular length use this form of initialization: string spaceString(length,' '); or use assign operator, spaceString assign (length,' '); Lab Assignment The project is due in one week. Specifically, it is due by the midnight on the day of the next lab. Implement the lab using procedural programming techniques only. That is, you are not allowed to define classes or objects. Dift. Implement a program that compares two text files character-by-character. The program should output the line numbers that contain different characters and the place where the two lines start to differ (the difference is denoted by (caret) character. If both files are identical, the program should output nothing. File lengths may differ. If one file is shorter than the other, the shorter file is assumed to have empty lines, i.e. the extra lines of the longer file are considered different from the empty lines of the shorter file. The file names should be passed as arguments on the command line. Assume the files exist. Assume the file names are the same length. If your program is not invoked with two arguments, it should print an error message and quit. The program operation should look like this: prompts diff file.txt file2.txt filei.txt: 20: Hello file2.txt: 20: Hallo filei.txt: 25: World???? file2.txt: 25: World! where 20 and 25 are line numbers. You are allowed to use getline() and string comparison functions in the implementation of this project. Milestone. Code that inputs two lines from two different files and determines whether they are the same. Hint. The command line arguments are input as C-style strings arguments to main(). See this program for an example of handling them. To configure command-line arguments for an MS Visual Studio project, right-click Solution Explorer, select "properties" from the drop-down menu, go to Configuration Properties Debugging and set "Command Arguments" in the properties list. To create a string of spaces of a particular length use this form of initialization: string spaceString(length,' '); or use assign operator, spaceString assign (length,' ')

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

Focus On Geodatabases In ArcGIS Pro

Authors: David W. Allen

1st Edition

1589484452, 978-1589484450

More Books

Students also viewed these Databases questions

Question

What is meant by a green or sustainable strategy?

Answered: 1 week ago

Question

2. What process will you put in place to address conflicts?

Answered: 1 week ago