Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
2
Answers
Narrowed Down Problem - Need help with Interface Constructor
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
james niesen
13y
2.1k
1
Reply
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]
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
Operation not supported on read-only collection in Silverlight
Line break in c#