OP 07 February, 2023 - 02:03 AM

my first c# program, program takes in a string input and outputs the number of vowels (a, e, i, o, u) and consonants in the string.
im learning c# rn any tips? will share code so u guys can maybe help me fix/upgrade my poor code
please review

https://anonfiles.com/xa1f38Wayf/VowelsCheck_rar
code:
https://paste.fo/2f91f23a52e9
namespace VowelsCheck
{
internal class Program
{
static void Main(string[] args)
{
Console.Title = "VowelsCheck";
string title = @"
██▒ █▓ ▒█████ █ █░▓█████ ██▓ ██████ ▄████▄ ██░ ██ ▓█████ ▄████▄ ██ ▄█▀
▓██░ █▒▒██▒ ██▒▓█░ █ ░█░▓█ ▀ ▓██▒ ▒██ ▒ ▒██▀ ▀█ ▓██░ ██▒▓█ ▀ ▒██▀ ▀█ ██▄█▒
▓██ █▒░▒██░ ██▒▒█░ █ ░█ ▒███ ▒██░ ░ ▓██▄ ▒▓█ ▄ ▒██▀▀██░▒███ ▒▓█ ▄ ▓███▄░
▒██ █░░▒██ ██░░█░ █ ░█ ▒▓█ ▄ ▒██░ ▒ ██▒▒▓▓▄ ▄██▒░▓█ ░██ ▒▓█ ▄ ▒▓▓▄ ▄██▒▓██ █▄
▒▀█░ ░ ████▓▒░░░██▒██▓ ░▒████▒░██████▒▒██████▒▒▒ ▓███▀ ░░▓█▒░██▓░▒████▒▒ ▓███▀ ░▒██▒ █▄
░ ▐░ ░ ▒░▒░▒░ ░ ▓░▒ ▒ ░░ ▒░ ░░ ▒░▓ ░▒ ▒▓▒ ▒ ░░ ░▒ ▒ ░ ▒ ░░▒░▒░░ ▒░ ░░ ░▒ ▒ ░▒ ▒▒ ▓▒
░ ░░ ░ ▒ ▒░ ▒ ░ ░ ░ ░ ░░ ░ ▒ ░░ ░▒ ░ ░ ░ ▒ ▒ ░▒░ ░ ░ ░ ░ ░ ▒ ░ ░▒ ▒░
░░ ░ ░ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░
░ ░ ░
";
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(title);
Console.ForegroundColor = ConsoleColor.Yellow;
Console.Write("Welcome to Vowels check, this program checks for vowels in your word/sentence. \nPlease enter a word/sentence: ");
Thread.Sleep(250);
string word = Console.ReadLine();
word = word.ToLower();
int vowels = 0;
int consonants = 0;
foreach (char letter in word)
{
switch (letter)
{
case 'a': vowels++; break;
case 'e': vowels++; break;
case 'i': vowels++; break;
case 'o': vowels++; break;
case 'u': vowels++; break;
default: consonants++; break;
}
}
Thread.Sleep(250);
Console.WriteLine("vowels: " + vowels);
Thread.Sleep(250);
Console.WriteLine("consonants: " + consonants);
Thread.Sleep(250);
Console.WriteLine("Thanks for using my first c# program! \nenter any key to exit");
Console.ReadKey();
}
}
}
{
internal class Program
{
static void Main(string[] args)
{
Console.Title = "VowelsCheck";
string title = @"
██▒ █▓ ▒█████ █ █░▓█████ ██▓ ██████ ▄████▄ ██░ ██ ▓█████ ▄████▄ ██ ▄█▀
▓██░ █▒▒██▒ ██▒▓█░ █ ░█░▓█ ▀ ▓██▒ ▒██ ▒ ▒██▀ ▀█ ▓██░ ██▒▓█ ▀ ▒██▀ ▀█ ██▄█▒
▓██ █▒░▒██░ ██▒▒█░ █ ░█ ▒███ ▒██░ ░ ▓██▄ ▒▓█ ▄ ▒██▀▀██░▒███ ▒▓█ ▄ ▓███▄░
▒██ █░░▒██ ██░░█░ █ ░█ ▒▓█ ▄ ▒██░ ▒ ██▒▒▓▓▄ ▄██▒░▓█ ░██ ▒▓█ ▄ ▒▓▓▄ ▄██▒▓██ █▄
▒▀█░ ░ ████▓▒░░░██▒██▓ ░▒████▒░██████▒▒██████▒▒▒ ▓███▀ ░░▓█▒░██▓░▒████▒▒ ▓███▀ ░▒██▒ █▄
░ ▐░ ░ ▒░▒░▒░ ░ ▓░▒ ▒ ░░ ▒░ ░░ ▒░▓ ░▒ ▒▓▒ ▒ ░░ ░▒ ▒ ░ ▒ ░░▒░▒░░ ▒░ ░░ ░▒ ▒ ░▒ ▒▒ ▓▒
░ ░░ ░ ▒ ▒░ ▒ ░ ░ ░ ░ ░░ ░ ▒ ░░ ░▒ ░ ░ ░ ▒ ▒ ░▒░ ░ ░ ░ ░ ░ ▒ ░ ░▒ ▒░
░░ ░ ░ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░
░ ░ ░
";
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(title);
Console.ForegroundColor = ConsoleColor.Yellow;
Console.Write("Welcome to Vowels check, this program checks for vowels in your word/sentence. \nPlease enter a word/sentence: ");
Thread.Sleep(250);
string word = Console.ReadLine();
word = word.ToLower();
int vowels = 0;
int consonants = 0;
foreach (char letter in word)
{
switch (letter)
{
case 'a': vowels++; break;
case 'e': vowels++; break;
case 'i': vowels++; break;
case 'o': vowels++; break;
case 'u': vowels++; break;
default: consonants++; break;
}
}
Thread.Sleep(250);
Console.WriteLine("vowels: " + vowels);
Thread.Sleep(250);
Console.WriteLine("consonants: " + consonants);
Thread.Sleep(250);
Console.WriteLine("Thanks for using my first c# program! \nenter any key to exit");
Console.ReadKey();
}
}
}