This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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): "); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) | |
{ |