60 709
Assignments Done
97,9%
Successfully Done
In April 2018

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
Expert's answer
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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions