I am trying to create a C# console app, where if a user presses a number it will ask them to add a task, view current task, delete a task. I have created my first class to "Add a task" just get the user input, and then in the main method call that class running the user input through it, any advice?
class addTask
{
public string UserInput { get; set; }
public override string ToString() => UserInput;
}
...
System.Console.WriteLine("Please select what you would like to do");
System.Console.WriteLine("1. Add A Task");
System.Console.WriteLine("2. Remove A Task");
System.Console.WriteLine("3. Update A Task");
System.Console.WriteLine("4. View Task");
int num = Convert.ToInt32(Console.ReadLine());
if (num == 1)
{
System.Console.WriteLine("Please enter a new Task");
string input = Console.ReadLine();
while (input != Console.ReadLine())
{
// a.getUserInput.ToString();
System.Console.WriteLine($"New Task: {a}");
break;
}
}
Console.ReadKey();