C# Using the class created in question 10 of part 1, create a second class that
ID: 3732039 • Letter: C
Question
C# Using the class created in question 10 of part 1,
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. Here is the information from part 1 for reference:
• 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.
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.