C# Program. 3. Create a base class to hold information about sporting tams on ca
ID: 3775701 • Letter: C
Question
C# Program.
3. Create a base class to hold information about sporting tams on campus. If you are using Visual Studio to develop your solution, use the class library template. Design the base class so that it is not possible to instantiate the class. include characteristics you would find with all sports, such as primary coach's name and the name of the sport. Since no class is required to test your subclasses, be sure to build the solution to ensure that no syntax errors exist.
4. Select two types of sporting teams and define subclasses for them. If you are using Visual Studio to develop your solution, use the class library template. These classes should inherit from a base team class such as that created in Exercise 3 (above). Include unique characteristics about the sport. For example, for a sporting team such as a tennis team, the field location and/or the person to contact to restring rackets may be of interest. Be sure to implement any virtual method included in the base class. Provide ToString() methods in both subclasses that invokes the ToString() metho in the base class and adds unique characteristics about the individual team to the return value. Since no class is required to test your subclasses, be sure to build the solution to ensure that no syntax errors exist.
Explanation / Answer
Ans 3) Abstract class of Sport
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace A_sport
{
public abstract class Sport
{
public string coachName;
public string SportName;
public abstract void Display();
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.