Log in from a computer to take this course

You'll need to log in from a computer to start Learn C#. But you can practice or keep up your coding streak with the Codecademy Go app. Download the app to get started.

apple storegoogle store

The Sedan needs to satisfy more than the highway patrol’s rules (the IAutomobile interface). The car designers have asked that sedans are built and move in certain ways — it must have constructors and methods that aren’t required by the IAutomobile interface. This is okay in C#! The interface says what a class MUST have. It does not say what a class MUST NOT have.

In fact, interfaces cannot specify two types of members that are commonly found in classes:

  • Constructors
  • Fields



Add a constructor to the Sedan class with one parameter, speed, of type double. It should

  • set the Speed property to speed
  • set a random LicensePlate value
  • set Wheels to 4

To make a random license plate, a utility class is provided for you. Use it in the constructor like so: Tools.GenerateLicensePlate().


Add a void SpeedUp() method that increases the Speed property by 5.


Did you get an error? There is no setter for the Speed property. Add a private setter to that property.


Add a void SlowDown() method that decreases the Speed by 5.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?