/WordCounter.Solution

A C# Console Application that counts the number of times a word occurs in a phrase.

Primary LanguageC#

Word Counter

A C# Console Application that counts word occurrences in a phrase, March 2020

By K. Wicz

Description

Word Counter gathers both a word and a phrase or sentence from a user, then returns the number of times the given word occurs within the given sentence.

Project Specifications

Behavior Input Output
User begins program by inputting two strings: a word and a phrase. "world", "Hello world" program creates new instance of user input
User inputs empty word or phrase " ", "Hello world" Error
User inputs a word which doesn't occur in the inputted phrase an program returns number of occurances. "universe", "Hello world" 0
User inputs a word which occurs in a phrase once and program returns number of occurances. "world", "Hello world" 1
User inputs word that is part of another word in the phrase and program does not count it as an occurance. "cat", "My cat is going to the cathedral" 1
User inputs word and a phrase containing the word in a different case "cat", "My cat Cat is going to the cathedral" 2
User inputs contain punctuation and the punctuation is replaced with " " "cat", "My cat, named Cat, my other cat, named Monkey, and my dog, also named Cat, went to the cathedral." "My cat named Cat my other cat named Monkey and my dog also named Cat went to the cathedral "

Setup/Installation Requirements

In your computer's terminal:

  1. Navigate to where you want this application to be saved, i.e.:
cd desktop
  1. Clone the file from GitHub with HTTPS
git clone 
  1. Enter into the new file directory
cd wordcounter.solutions
  1. Start the program
dotnet run

Known Bugs

No known bugs at this time.

Support and contact details

Have a bug or an issue with this application? Open a new issue here on GitHub.

Technologies Used

  • C#
  • .NET Core
  • MSTest
  • C# Template Generator by Dusty McCord and Patrick Kille

License

MIT

Copyright (c) 2020 K.Wicz