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); } } }
Comments
Leave a comment