- Move all common properties in your vehicles to a new
Vehicle
class. - Create an instance of each vehicle.
- Define a different value for each vehicle's properties.
- Create a
Drive()
method in theVehicle
class. - Override the
Drive()
method in all the other vehicle classes. Include the vehicle's color in the message (i.e. "The blue Ram drives past. RRrrrrrummbbble!"). - Create a
Turn(string direction)
method, and aStop()
method onVehicle
. Define a basic implementation of each. - Override all three of those methods on some of the vehicles. For example, the
Stop()
method for a plane would be to output the message "The white Cessna rolls to a stop after rolling a mile down the runway." - Make your vehicle instances perform all three behaviors.
-
Notifications
You must be signed in to change notification settings - Fork 0
chadjones839/custom-colors
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
C# class inheritance exercise
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published