Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Assignment #5 Description: This assignment is an exercdise in using a moderately complex class (provided for you) and using those classes and objects to

image text in transcribed
image text in transcribed
Programming Assignment #5 Description: This assignment is an exercdise in using a moderately complex class (provided for you) and using those classes and objects to count the number of words in a file, count the number of unique words in a file, and alphabetize those words and print a report. Programming Specifications Task: Two files have been provided (wordcounter.h and wordcount.cpp). You must open a text file, read in each word until end of file, add each word to the WordCount library and print the report. You will have a driver program that is named using your JSUID as part of the file name. (Example cco10labs.cpp) . . Your driver program will include "wordcounter.h" . Your program must request a filename of a text file that contains words to count. You must check to see if it is a valid file and issue an error message if not and request a new file name until a valid one is entered. You must have at least one function that either passes in a parameter and at least one function that returns a value. You can have a single routine that does both. You must declare the class object properly, use AddWord() to add the word to the catalog and use PrintSummary) to produce the output. . . Design Considerations: The file will contain only words (no punctuation or special characters) less than or equal to 13 letters. There will be no limit to the number of words. 1. 2. You must open the file and read each individual word using standard input (cin) until the end-of 3. file is detected calling AddWord) class member function to add the word to the dass library The file must be closed properly. You must use three separate files in your design (1) Your driver program, "wordcounter.h", and "wordcounter.cpp". 4. General Requirements: 1. 2. 3. 4. No global variables, other than constants! Use the const qualifier on member functions wherever it is appropriate. You will need to use the kiostream> library for output You must include the wordcou along with your driver file. nter.h file in your program and compile the wordcount.cpp file Sample File called word.txt The moving finger writes and having writ moves on nor all the piety nor wit shall lure it back to cancel half a line nor all the tears wash out a word of it Sample output: Please Enter a File Name: word.txt Nord Counter Summary Word Count ALL AND BACK FINGER HALF HAVING LINE CS 231 Pagi CS231 Programming I in C/C++ LURE MOVES MOVING NOR OF OUT PIETY SHALL TEARS THE TO NASH WIT WORD WRIT WRITES Total Number of Words: 34

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

Objects And Databases International Symposium Sophia Antipolis France June 13 2000 Revised Papers Lncs 1944

Authors: Klaus R. Dittrich ,Giovanna Guerrini ,Isabella Merlo ,Marta Oliva ,M. Elena Rodriguez

2001st Edition

3540416641, 978-3540416647

More Books

Students also viewed these Databases questions

Question

Buret Initial Reading Buret Final Reading

Answered: 1 week ago