Some "other" developers have been working on the remote control car project exercise:csharp/remote-control-competition. You have been called in to clean up the code.
Refactor the RemoteControlCar class to move to separate out telemetry methods and properties accessed via a Telemetry property.
var car = new RemoteControlCar();
car.Telemetry.Calibrate();
car.Telemetry.SelfTest();
car.Telemetry.ShowSponsor("Walker Industries Inc.");
car.CurrentSponsor
// => "Walker Industries Inc."
car.Telemetry.SetSpeed(100, "cps");
car.GetSpeed()
// => "100 centimeters per second"Ensure that the Telemetry instance cannot be created outside the scope of the car.
Ensure that the Speed struct cannot be used outside the scope of the RemoteControlCar class.
Ensure that the SpeedUnits enum cannot be used outside the scope of the RemoteControlCar class.
Some "other" developers have been working on the remote control car project exercise:csharp/remote-control-competition. You have been called in to clean up the code.
Refactor the RemoteControlCar class to move to separate out telemetry methods and properties accessed via a Telemetry property.
var car = new RemoteControlCar();
car.Telemetry.Calibrate();
car.Telemetry.SelfTest();
car.Telemetry.ShowSponsor("Walker Industries Inc.");
car.CurrentSponsor
// => "Walker Industries Inc."
car.Telemetry.SetSpeed(100, "cps");
car.GetSpeed()
// => "100 centimeters per second"Ensure that the Telemetry instance cannot be created outside the scope of the car.
Ensure that the Speed struct cannot be used outside the scope of the RemoteControlCar class.
Ensure that the SpeedUnits enum cannot be used outside the scope of the RemoteControlCar class.