C# Language You are creating an application that will be used to help manage a p
ID: 3804023 • Letter: C
Question
C# Language
You are creating an application that will be used to help manage a parking structure. Describe (without code) a custom class you would create for this application, at least 2 attributes and one behavior method for this class and describe an example instance of the class.
Provide a code sample of the constructor for the class described in question 3. Provide a code sample of the constructor being used to create an instance of the class.
Using the class created above, create a second class that inherits from it. Define two additional attributes and provide a code sample of the constructor for the new class that references the base class.
Explanation / Answer
We will have a ParkingSpot class. our HandicapParkingSpot class and RegularParkingSpot class can inherit it. It is used to simultate a parking spot.
attributes:
Constructor code:
---------------------------------
our HandicapParkingSpot class will extend ParkingSpot class
string type="handicap"
string sizeofspot="Large"
constructor
public HandicapParkitSpot(int spaenum) : base(int spacenum )
{
Console.WriteLine("Derived Class Default Constructor");
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.