Example #1
0
    private void AddTiger()
    {
        string name   = CreateName();
        int    weight = CreateSpecial();

        while (true)
        {
            Console.WriteLine("\nPlease confirm that the specifics are correct: \n" +
                              "Name: " + name + "\nWeight: " + weight + " kg\nDo you wish to add this tiger? y/n");

            string input = Console.ReadLine().ToLower();
            if (input == "n")
            {
                Clear();
                Console.WriteLine("\nCancelled registration\n");
                return;
            }
            else if (input == "y")
            {
                Tiger t = new Tiger(name, weight, true, CurrentDateTime());
                animals.Add(t);
                Console.WriteLine("\nYour tiger was added \n\nId: " + t.GetId() + "\nName: " + t.GetName() +
                                  "\nStatus (living): " + t.GetLiving() + "\nLast updated: " + t.GetLastUpdated() +
                                  "\nWeight (kg): " + t.GetWeight() + "\nSpecies: " + t.GetSpecies() + "\n");
                return;
            }
            else
            {
                Console.WriteLine("Please enter 'y' or 'n'");
                continue;
            }
        }
    }