james niesen

james niesen

  • NA
  • 1
  • 2.3k

Narrowed Down Problem - Need help with Interface Constructor

Aug 17 2011 10:57 AM
I'm storing the following information about a small car:
max speed = 100
fuel efficiency = 50
mpg = 30
reliability factor = 7

I have a class SmallCar that inherits a IVehicle interface.  I'm stuck on how to add the constructors.  Can someone please help:
[code]
namespace Assets.Classes
{
 public interface IVehicle
 {
 int MaxSpeed { get; set;}
 int FuelEfficiency {get; set;}
 double ReliabilityFactor { get; set; }
 
double LifeSpan { get; set; }
 }

 public class SmallCar : IVehicle
 {

 protected int maxSpeed { get; set; }
 
protected int fuelEfficiency { get; set; }
 
protected double reliabilityFactor { get; set; }
 
protected double lifeSpan { get; set; }

class SmallCar : IVehicle
        Here's where I'm stuck trying to add constructor logic
}

 }

 }


[/code]

Answers (2)