Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

c homework 37

Read pp. 716 through 726 in our textbook and write a program using cin.get() and cin.eof() that reads a text file (.csv), one-character-at-a-time, and displays the total number of characters, words, and lines in the file. Name the source code file wc.cpp. The output should look like the example below after a run printing out just three numbers (characters, words, lines respectively):

Example:

wc < airport-codes.csv

24733 3382 462

Hint: The numbers reported in the example above are fake.

Hint: Assume you enter a word when you sense a character other than whitespace, spaces, underbars (_), or dashes (-).

Hint: Use OS redirection to read from the file like we did in class: wc < file.csv

Hint: You can paste the contents of your data file into https://wordcounter.net to get a baseline count for characters and words. Then you can compare your programs outputs against those number as a sanity check. NOTE: Be aware that your counts might not match exactly but if you’re close that’s good enough.

 
"Looking for a Similar Assignment? Order now and Get 10% Discount! Use Code "Newclient"