Hello, I’m working on this task:
Write a program that asks the user how they are doing by using the phrase “How are you?” If the user answers “fine”, respond with “Life is great!” Otherwise, try to cheer them up - respond with “Everything’s gonna be alright.”
Here is my code:
namespace ConsoleInput
{
public class MoodChecker
{
public static void Main(string[] args)
{
Console.WriteLine("How are you?: ");
string svar = Console.ReadLine();
if (svar == "fine")
{
Console.WriteLine("Life is great!");
}
else
{
Console.WriteLine("Everything's gonna be alright.");
}
}
}
}
Can anyone please help me to solve it?