- 1

Can anybody solve this please ? That's how far I got not the requested but don`t know if the request is basically valid .

#Csharp Track - Assignment 5 : Create a C# program that implements an abstract class Animal that has a Name property of type text and three methods SetName (string name), GetName, and Eats. The Eat method will be an abstract method of type void. You will also need to create a Dog class that implements the above Animal class and the Eat method that says the dog is Eating. To test the program ask the user for a dog name and create a new Dog type object from the Home controller Index Action of the application, give the Dog object a name, and then execute the GetName and Eat methods. using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace Csharp_Assignment_5 { public abstract class Animal { public string Name { get; set; } public abstract void Eat(); } } namespace Csharp_Assignment_5 { public class Dog : Animal { public override void Eat() { Console.WriteLine("The Dog is eating"); } } } using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace Csharp_Assignment_5.Controllers { public class HomeController : Controller { public ActionResult Index() { Dog dog = new Dog(); dog.Name = "Jaja"; return Content("The Dog name is " + dog.Name); } public ActionResult About() { ViewBag.Message = "Your application description page."; return View(); } public ActionResult Contact() { ViewBag.Message = "Your contact page."; return View(); } } } @{ ViewBag.Title = "Home Page"; }

14th Jul 2022, 10:40 PM
Mustafa Azzoz
Mustafa Azzoz - avatar
2 Respuestas
0
Anna
17th Jul 2022, 9:37 AM
Kiran kumar Kumar
Kiran kumar Kumar - avatar
0
Hello Sir Please Java narapanchu
17th Jul 2022, 9:38 AM
Kiran kumar Kumar
Kiran kumar Kumar - avatar