Ejemplo n.º 1
0
        private void PlayTheFairyTale()
        {
            FairyTale      newFairyTale = new FairyTale();
            FairyTale_Repo newFairyRepo = new FairyTale_Repo();



            Console.WriteLine("Please enter an adverb (example: quickly, softly, well)");
            newFairyTale.Adverb = Console.ReadLine();

            Console.WriteLine("Please enter an age");
            string ageAsString = Console.ReadLine();

            newFairyTale.Age = int.Parse(ageAsString);

            Console.WriteLine("Please enter a name");
            newFairyTale.Name = Console.ReadLine();

            Console.WriteLine("Please enter a noun");
            newFairyTale.Noun = Console.ReadLine();

            Console.WriteLine("Please enter a place");
            newFairyTale.Place = Console.ReadLine();

            Console.WriteLine("Please enter a verb");
            newFairyTale.Verb = Console.ReadLine();

            Console.WriteLine("Please enter wedding date example: (1/28/2015) (m/d/year)");
            string dateAsString = Console.ReadLine();

            newFairyTale.WeddingDate = DateTime.Parse(dateAsString);

            Console.WriteLine(newFairyRepo.CreateFairyTale(newFairyTale));
        }
Ejemplo n.º 2
0
 public string CreateFairyTale(FairyTale word)
 {
     return($" Once upon a time in {word.Place}, there was a Princess named {word.Name}. \n" +
            $"She lived in a beautiful {word.Noun} but was very lonely.  One day \n" +
            $" a {word.Verb} visitor came to the castle.  It was none other than the {word.Verb} \n" +
            $"Prince named {word.Name} who lived in a different kingdom. They fell in love {word.Adverb} and \n" +
            $"got married on {word.WeddingDate}. She was only {word.Age} years old.");
 }