Using C for the following The program uses 24 letters in the

Using C# for the following:

The program uses 24 letters in the Greek alphabets (alpha, beta, gamma, delta, epsilon, zeta, eta, theta, iota, kappa, lambda, mu, nu, xi, omicron, pi rho, sigma, tau, upsilon, phi, chi, psi, and omega). Create a string array above your Main()method. String () declaration with static. Create a method that will return Greek letter base:

Solution

using System;

public class Test
{
   public static string[] greekAlpha = {
       \"alpha\",   \"beta\",
       \"gamma\", \"delta\",
       \"epsilon\",   \"zeta\",
       \"eta\",   \"theta\",
       \"iota\",   \"kappa\",
       \"lambda\",   \"mu\",
       \"nu\",   \"xi\",
       \"omicron\",   \"pi\",
       \"rho\", \"sigma\",
       \"tau\", \"upsilon\",
       \"phi\", \"chi\",
       \"psi\",\"omega\"};
  
   public static string greekLetter(int i){
       return \"Letter \"+i.ToString()+\" is \"+greekAlpha[i-1];
   }
  
   public static void Main()
   {
       while(true){
           Console.WriteLine(\"Enter a number between 1-24 or 99 to quit: \");
       string x = Console.ReadLine();
       int i =0;
           if(int.TryParse(x, out i)==false){
           Console.WriteLine(\"Invalid Input. Try Again: \");
           }else{
           i = int.Parse(x);
           if(1<=i && i<=24){
               Console.WriteLine(greekLetter(i));
           }else if(i==99){
               break;
           }else{
           Console.WriteLine(\"Invalid Input. Try Again: \");
           }
           }
       }
      
   }
}

Using C# for the following: The program uses 24 letters in the Greek alphabets (alpha, beta, gamma, delta, epsilon, zeta, eta, theta, iota, kappa, lambda, mu, n

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site