This exercise is designed to take a word from a user and then a sentence that may have the word in it a certain number of times. The program will return to the user the amount of times the word is in their sentence. It will make sure that their word is not a part of another word. Test Methods are a large part of the practice of this exercise and DRYing up our code to be able to use and edit our methods without altering our Program code. The next large practice part of this project is building out an MVC web user interface.
| Spec | Input | Output |
|---|---|---|
| Returns a number pertaining to the amount of times a word was found in a string. | Input: "hat" Input: "That emphatic hateful manhattan chatterbox has a phat hat." | Output: "You used "hat" 1 time." |
| Returns a number pertaining to the amount of times a word was found in a string if the word starts with an uppercase letter and the original word doesn't. | Input: "is" Input: "Is this a persistent sunrise or is it going to end?" | Output: "You used "is" 2 times. |
| Can account for numbers too, as long as the number isn't part of another word or number. | Input: "2019" Input: "In 2019, I have been awake for 201958 hours." | Output: "You used "2019" 1 time." |
| If a word isn't in the sentence, returns a message with 0. | Input: "zero" Input: "How many times?" | Output: "You used "zero" 0 times." |
| Counts words with mixed uppercase letters. | Input: "funky" Input: "FuNkY behaviors call for fUnKy specs." | Output: "You used "funky" 3 times." |
- You can check out the repository link in my github pages Link to repository
You need a a terminal or command line and .Net Core 2.2 to be able to run the code
_GIT Bash, , .NET-Sdk-2.2-x64 _
Licensed under the GPL License Copyright (c) 2019 Stephen Trewick