Is there any other way to shorten this code without sacrificing readability? I am fairly new to C#, let alone programming, and I wanted to know if this is as short as this code can possibly become. Feedback would be greatly welcomed.
Side note: was Questions.Questask
used properly here, or could there have been a better way?
class Program
{
static void Main(string[] args)
{
string name = "";
while (name.ToLower() != "none")
{
Console.WriteLine("Are you Kydd,Leo,Jay,Sha, or Zigg");
name = Console.ReadLine();
if (name.ToLower() == "kydd")
Question.Questask("Input question here", "Kquestion","Link");
else if (name.ToLower() == "leo")
Question.Questask("Input question here", "Lquestion", "Link");
else if (name.ToLower() == "jay")
Question.Questask("Input question here", "Jquestion", "Link");
else if (name.ToLower() == "sha")
Question.Questask("Input question here", "Squestion", "Link");
if (name.ToLower() == "zigg")
Question.Questask("Input question here", "Zquestion", "Link");
}
}
class Question
{
public static void Questask(string question, string questAnswer, string url)
{
Console.WriteLine(question);
questAnswer = Console.ReadLine();
if (questAnswer.ToLower() == "yes")
{
Console.WriteLine("You are right!");
Console.ReadKey();
}
else
{
System.Diagnostics.Process.Start(url);
}
}
}
}