Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Programming, C++!!! sample output file Properties.txt: Note: Write a class TextFile and name your main exactly hw3.cpp, and the rest being textfile.h and textfile.cpp.

C++ Programming, C++!!!

image text in transcribed

sample output file "Properties.txt":

image text in transcribed

Note: Write a class TextFile and name your main exactly hw3.cpp, and the rest being textfile.h and textfile.cpp.

Problem 1: Using good coding practices, write a program that compares the contents of two .txt" files and then saves the properties of the files in another Properties.txt file. The properties of the each file should include the name of the file, the number of characters, the number of words, and a sentence stating if one file has more lines than the other or the same amount of lines. Your program should prompt the user for the name of the files. Use operator overload- ing to write functions that compare both files by the amount of lines such that ( file1 > file2 ) returns true if file1 contains more lines than file2 and false otherwise. Similarly ( file1 == file2 ) returns true if the files contain the same amount of lines. Figure 1 shows a sample output for the given file1 and file2. Properties - Notepad File Edit Format View Help File Name: JEMAbstract.txt Number of characters: 338 Number of words: 46 File Name : PhysicaDAbstract.txt Number of characters: 221 Number of words: 29 The file named "JFMAbstract.txt" has less lines than "PhysicaDAbstract.txt

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

OpenStack Trove

Authors: Amrith Kumar, Douglas Shelley

1st Edition

1484212215, 9781484212219

More Books

Students also viewed these Databases questions

Question

Know the three main dimensions of the service environment.

Answered: 1 week ago

Question

Understand the roles of signs, symbols, and artifacts.

Answered: 1 week ago

Question

Discuss the key ambient conditions and their effects on customers.

Answered: 1 week ago