02 May QuestionCIT1154 – Assignment 5 Document Analysis Conditional statements, function
Question
CIT1154 – Assignment 5 Document Analysis Conditional statements, functions, scope, file I/O, strings, vectors
Description Write a modular program to do the following:
• Ask the user for a file to read. • Read through that file and count all the occurrence of each word that is found. • Output this list of words (along with their counts) to the screen.
At a minimum, there should be:
• Since we have no idea of the amount of words that the file might contain a vector is the natural choice for data storage. Use one vector to store the word and another vector to keep track of how often the word occurs. We would call these parallel vectors since the word at position five would have its count stored in the fifth position of the second vector.
• A main()function that controls the operation of the program • A findWordPosition() function that takes a vector and a string as parameters and returns the
position that the string occupies in the vector. If the string is not found return -1. This would be useful to see if the word has already been added. When comparing words please ignore all case. For example: barry would match Barry or BARRY or baRRy.
• A addWord() function that takes a string and two vectors as parameters. Store the new word in the vector and in the parallel vector set the count to 1.
• A reportToScreen() function that takes two vectors (words and the count) as parameters and displays 3 columns of words followed by their number of occurrences. Note: If you calculate and use the size of the largest word you can be sure that your columns will stay aligned.
Submission All parts of the submission are to be uploaded in Canvas by the due date. Refer to the style guide posted in Canvas!
1. Write and submit a C++ source code file that implements your solution. (.cpp) a. Your source code must contain appropriate internal documentation (comments) b. Your source code must be neatly formatted for readability.
2. Write and submit an external documentation file (.pdf) that documents your solution. a. Program summary b. Documentation of working features (may include screenshots or descriptions of tests) c. Description of any problems you tested that caused the program to break, but you could
not fix. (known issues)
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.
About Writedemy
We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.
How It Works
To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Are there Discounts?
All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.
