PA 7.2: Word stats with functions
- Due Apr 13, 2021 by 11:59pm
- Points 10
- Submitting a file upload
- File Types cpp
- Available after Mar 30, 2021 at 2pm
When completing this programming assignment, you may work with up to one other person. No groups of more than two are permitted.
This programming assignment has all the same functionality as PA 5.1: Word stats , but your implementation must define and invoke the following well-documented (including a JavaDoc above each one) functions:
- a function that downcases a word
- input: a word
- return: the downcased version
- a function that prints a word's entry in the distribution list (i.e. "lamb ####")
- input: the word to print and its frequency
- return: nothing (it should display text to the screen, but not return anything)
Copy the following header and specifications checklist and paste it at the top of your source code. As you complete the specifications, fill in the [ ] next to that specification in the check list (e.g., like this: [x]). I will not grade submissions with missing specifications; please do not submit if you cannot check all of them off. This specs checklist is essentially a way for you to self grade before you submit your program.
// Name:
// Date:
// Partner:
//
// Specifications checklist for PA 7.2 Word Stats with functions
//
// General specs:
// [ ] the header includes your name and anyone you worked with
// [ ] the header includes this specifications checklist with all completed
// specifications checked off: [x]
// [ ] the code is indented properly (inside of every block, code is indented
// one more tab)
// [ ] each chunk of code that "hangs together" (works toward a higher level goal):
// [ ] includes a brief, useful comment above it
// [ ] is separated from the next chunk by a blank line
// [ ] there are no really long lines of code or comments (if you have long
// lines, split them across multiple shorter lines)
// [ ] identifiers are well named
// [ ] the program compiles
// [ ] the program runs without crashing or hanging
// [ ] all output and prompts look clean (correct spelling, capitalization,
// nothing squished)
// [ ] all prompts make it clear what data the user is expected to enter and in
// what format and work as expected
// [ ] every function includes a JavaDoc above it that specifies all present
// parameters and return values.
//
// Specific specs:
// [ ] the program prompts the user for their text (can be multiple lines of text)
// [ ] all words entered by the user are read in until the sentinel DONEZO is read in
// [ ] the DONEZO sentinel is not counted in any of the stats
// [ ] the program uses parallel (multiple) arrays or vectors to store words and their counts
// [ ] words are stored and reported at the end in all lower case
// [ ] these stats are displayed at the end and are accurate:
// [ ] the total number of words entered
// [ ] the number of distinct words (case insensitive)
// [ ] the number of characters (the length of all input words summed together,
// spaces not included)
// [ ] the distribution of distinct words and their corresponding counts are
// represented as a bar graph
// [ ] the left side of the bar graphs are aligned across words
// [ ] a function is defined and invoked correctly that downcases words
// (inputs: a word, return: the downcased)
// [ ] a function is defined and invoked correctly that prints a word's entry in the distribution output
// (inputs: a word and its frequency, return: nothing)
If you are working with a partner, both of you must submit individually.