Skip to content

Instantly share code, notes, and snippets.

View sammysheep's full-sized avatar

Sam Shepard sammysheep

View GitHub Profile
@sammysheep
sammysheep / SmithClass-WordCount.cs
Last active May 24, 2023 12:56
SmithClass-WordCount
// Word Count - counts letters, words, and lines similar to Unix `wc`
string filename = "";
if (args.Length != 1)
{
Console.WriteLine($"\nUsage:\n\tdotnet run <filename>\n");
System.Environment.Exit(1);
}
else
{
@sammysheep
sammysheep / SmithClass-VowelCount.cs
Last active April 26, 2023 00:22
SmithClass-VowelCount
// Vowel Count - returns the number of vowels in a document from the command line
string filename = "";
if (args.Length != 1)
{
Console.WriteLine($"\nUsage:\n\tdotnet run <filename>\n");
System.Environment.Exit(1);
}
else
{
@sammysheep
sammysheep / SmithClass-SumArray.cs
Last active April 5, 2023 13:03
SmithClass-SumArray
// Sam Shepard - 2023
// SumArray - add numbers to a List until we are given the word "STOP"
// Creates the sum and the average of the array entered.
List<int> my_power_levels = new List<int>();
while (true)
{
Console.Write("Enter a power level ('STOP' to stop): ");
@sammysheep
sammysheep / SmithClass-Summer.cs
Last active March 15, 2023 12:57
Smith Class - Summer skeleton
// Sam Shepard - 2023
// Summmer - sums up numbers that are positive and returns the sum
int n; // the count of numbers entered
int sum; // the sum of numbers entered
int average; // the average number as an integer
// Read numbers from the Console until a non-positive number is entered
while (true)
{