/// <summary> /// Asks for a task # then displays task and confirms user decision to delete this task. /// </summary> public void RemoveTask() { Console.Write("Which task # would you like to remove? "); int option = ValidCheck(Console.ReadLine(), 0, (ToDos.Count)); int index = option - 1; Console.WriteLine("Current Task is as follows:\n"); Console.WriteLine($"Task#{option}"); Console.WriteLine($"Team Member: {ToDos[index].Member}"); Console.WriteLine($"Date: {ToDos[index].Date}"); Console.WriteLine($"Status: {ToDos[index].Status}"); Console.WriteLine($"Description: {ToDos[index].Description}\n"); Console.WriteLine(); while (true)//A loop to insure user gives y/yes or n/no to mark task complete { Console.WriteLine("Are you sure you want to delete this task?"); string userInput = Console.ReadLine().ToLower().Trim(); if (userInput == "y" || userInput == "yes") { ToDos.RemoveAt(index); break; } else if (userInput == "n" || userInput == "no") { break; } else { Console.WriteLine("Please enter yes or no.\n"); } } }