How to count total lines words and chars in two files using command line argumen

How to count total lines words and chars in two files using command line arguments and how to implement find char.This assignment involves writing a C++ program to identify and count lines, words, andcharacters. For the purpose of this assignment, we define a “word” as a sequence of charactersthat are not whitespace characters. Words are delimited by one or more whitespace characters.A whitespace character, such as a space, tab, or newline, is any character for which the<cctype> function isspace() returns a value of true.The operation of your program is controlled by the command line arguments that are passed toyour program. Command line arguments consist of an optional set of flags arguments (a flagargument is an argument whose first character is a dash), followed by an optional list offilenames. If no filenames are specified, the program should read from standard input.For each file specified (or, in the case of no file names specified, the standard input), theprogram must read the entire input and produce a count of characters, lines, and words. Theoutput should be printed, one line per file, as follows:Lines words characters filenameThe numerical output (lines, words, characters) should be printed right justified in columns thatare 12 characters wide. The filename should be printed left justified in the fourth column. In thecase where the program in reading standard input, no filename should be printed.If the program reads multiple files, then it should also provide a line at the end of the output witha total of all of the lines, words and characters in all of the files that were processed. The totalsare tagged with the label “total”:totalLines totalWords totalCharacters totalIf the program is run with a flag in the form “-findchar=x”, then the program must also count thenumber of times it sees the character x in each file.For example if I run the program by sayingprogram -findchar=m infile1 infile2Then the output might be:10 200 1000 infile120 150 1010 infile230 350 2010 totalm: 3 20 100 infile1m: 0 0 0 infile2m: 3 20 100 total1 CS280 Programming Assignment 1Spring 2017 This means that the letter m appears on 3 different lines in infile1, in 20 different words, for atotal of 100 timesIf the program is run with a flag in the form “-findword=thisword”, then the program must countthe number of times it sees the word thisword in each file.For example if I run the program by sayingprogram -findword=this infile1Then the output might be:10 200 1000 infile1this: 7 12 infile1This means that the word this appears on 7 different lines for a total of 12 times.The program should accept multiple -findchar= arguments and multiple -findword= arguments,in any order. The output should be counts, then all findchar cases in alphabetical order, then allfindword cases in alphabetical orderThe student will be provided with a test script, a set of test files, and a series of test cases.There are several error cases that must be handled:Error Action A file is not found Print “File filename is not found” and stop An argument is poorly formed (a knownargument is missing the = sign, has nothingafter the = sign, or (in the case of findchar,has more than one character after the =) Print “Argument arg is poorly formed” andstop An argument is not recognized Print “Argument arg is not recognized” andstop A flag is duplicated Ignore the fact that a particular flag argumentis duplicated. Only process each letter orword one time no matter how many times it isspecified on the command line A file name appears more than once The file should be processed each time thename appears in the list 2 CS280 Programming Assignment 1Spring 2017 DUE DATES AND TEST CASESOn Feb 6, the following test cases will be due and must pass:- Compile- Count lines, words and characters in one file- Correctly handle the file not found error case- Detect poorly formed arguments- Detect unrecognized argumentsOn Feb 13, the following test cases will be due and must pass:- All Feb 6 test cases- Handle multiple files- Handle reading from standard input- Case of single findwordOn Feb 20, the following test cases will be due and must pass:- All Feb 13 cases- Full implementation of findword- Full implementation of findcharThe first two deliverables will have a 3 day grace period, where 10% of the grade for thosedeliverables is lost for every day of lateness.The final deliverable will have a 7 day grace period, where 10% of the grade for the deliverableis lost for every day of latenessSample files and test cases will be provided and will automatically populate in Vocareum. 3

QUALITY: 100% ORIGINAL PAPERNO PLAGIARISM - CUSTOM PAPER

Recent Completed and delivered Papers

# Topic title Subject Area Academic Level Pages delivered
6
Writer's choice
Business
University
2
1 hour 32 min
7
Wise Approach to
Philosophy
College
2
2 hours 19 min
8
1980's and 1990
History
College
3
2 hours 20 min
9
pick the best topic
Finance
School
2
2 hours 27 min
10
finance for leisure
Finance
University
12
2 hours 36 min