_
Behavior | Input | Output |
---|---|---|
User enters in a sentence, and the program counts the number of times a word appears | "word 1, word 2, word 3" | 3 |
| Take user sentence and return it all to lower case. To account for case sensitivity. | "WoRd1, WOrd2, wORd3" | "word1, word2, word3" | : this will make sure the program can correctly evaluate the words to eachother.
| Take User sentence and split into an array of strings. | "word1, word2,word3" | [word1, word2, word3] | : This is allow the program to split the words up into an array and test them individually.
| create a number counter to hold amount of times word has shown up | "word1, word2, word3" | counter = 3 | : This will hold the amount of times a word shows up so we can show it back to the user.
| Once Number of words has been tallied. Show user the sentence and the number of times the word appeared | "word1, word2, word3" | "word1 word2 word3" Word showed up 3 times. | : this will be the final step, showing the user the word and the count.
| Check to see if users Phrase has a space in it | "word1, word2, word3" | true | : this will check to see if the users phrase includes a space
| User enters a string with a number, returns true. If not returns false | "word1" | True | : Check if the user enters a string with a number in it, and return statement to the user that numbers re not allowed.
| User enters a string with a symbol, returns true. If not returns false | "word$" | True | : Check if the user enters a string with a symbol in it and return statement to the user that symbols are not allowed. _
- _Clone down from GitHub
- Open in any text editor or IDE
- Compile program either in terminal or through IDE
- Enter in a sentence and see the amount of times a word appears
No Databases or servers required. Just compile program and run
No bugs at this time
If any bugs are found please contact me at joebarnes333@gmail.com
C# programing language and Visual Studio IDE
Copyright (c) 2019 Joe Barnes