Answer to Question #46365 in C# for DIPINI

Question #46365
write a program to check whether inputted alphabet is vowel or not using switch case
1
Expert's answer
2014-09-23T04:54:18-0400
using System;
namespace Question
{

class Program
{
static void Main(string[] args)
{
ConsoleKeyInfo key;
do
{
Console.Clear();
Console.WriteLine("Input your alphabet symbol(ESC - exit): ");
key = Console.ReadKey();
if (key.Key == ConsoleKey.Escape) return;
Console.WriteLine();
switch(char.ToLower(key.KeyChar))
{
case 'e': Console.WriteLine("Inputed alphabet symbol is vowel");break;
case 'y': Console.WriteLine("Inputed alphabet symbol is vowel");break;
case 'i': Console.WriteLine("Inputed alphabet symbol is vowel");break;
case 'o': Console.WriteLine("Inputed alphabet symbol is vowel");break;
case 'a': Console.WriteLine("Inputed alphabet symbol is vowel");break;
default: Console.WriteLine("Inputed alphabet symbol isn`t a vowel");break;
}
Console.WriteLine("Press any key to continue...");
Console.ReadKey();
}while(true);
}
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS