Skip to content

chadjones839/custom-colors

Repository files navigation

Practice: Custom Colors and Sounds

  1. Move all common properties in your vehicles to a new Vehicle class.
  2. Create an instance of each vehicle.
  3. Define a different value for each vehicle's properties.
  4. Create a Drive() method in the Vehicle class.
  5. 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!").
  6. Create a Turn(string direction) method, and a Stop() method on Vehicle. Define a basic implementation of each.
  7. 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."
  8. Make your vehicle instances perform all three behaviors.

About

C# class inheritance exercise

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages