C Program Create a base class to hold information about spor

C# Program. 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. Define properties, a ToSgring( ) method, and a minimum of one virtual method that can be redefined for specific sports. The ToString( ) method should return the name of the sport and coach. Since no class is required to test your base class, be sure to build the solution to ensure that no syntax errors exist.

Solution

Teams.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ClassLibrary1
{
public abstract class Teams
{
protected string PrimaryCoach = “Rahul”;
protected string TypeofSport;

public Teams()
{
}

  

public virtual string[] sport()
{
string[] SportArray = new string[4];
SportArray[0] = PrimaryCoach;
SportArray[1] = TypeofSport;
return SportArray;
}

}
}

=====================================================================================

GolfTeam.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ClassLibrary1
{
public class GolfTeam: Teams
{
string Location;
string ContactforEquipment;
string CoachName;
string PhoneNumber;

public GolfTeam()
{
CoachName = “Lesner”;
PhoneNumber = “122-123-890”;
Location = “West”;
   TypeofSport = \"Golf\";

}

public override string[] sport()
{
string[] GolfTeamArray = new string[4];
GolfTeamArray[0] = CoachName;
GolfTeamArray[1] = PhoneNumber;
GolfTeamArray[2] = PrimaryCoach;
GolfTeamArray[3] = Location;

return GolfTeamArray;
}
  

}
}

====================================================================================

FootballTeam.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ClassLibrary1
{
public class FootballTeam: Teams
{
string Location;


string PersontoContactforBall;
string CoachName;
string PhoneNumber;

public FootballTeam()
{
CoachName = “GoldBerg”;
PhoneNumber = \"949-123-4567\";
FieldLocation = “West”;
  TypeofSport = \"Football\"
}

public override string[] sport()
{
string[] FootballArray = new string[4];
FootballArray[0] = CoachName;
FootballArray[1] = PhoneNumber;
FootballArray[2] = PrimaryCoach;
FootballArray[3] = FieldLocation;
return FootballArray;
}

}
}

Note: Make sure you put these files using Class Library Template, Compile it and Build it
Let me know if you have any concern, I hope it clarifies

C# Program. 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 librar
C# Program. 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 librar

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site