Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private double fuelQuantity;
- public double FuelQuantity
- {
- get
- {
- return this.fuelQuantity;
- }
- private set
- {
- if (value <= this.TankCapacity)
- {
- this.fuelQuantity = value;
- }
- else
- {
- this.fuelQuantity = 0;
- }
- }
- }
- public double FuelConsumption { get; private set; }
- public double TankCapacity { get; set; }
- public Vehicle(double fuelQuantity, double fuelConsumtpion, double tankCapacity)
- {
- this.FuelQuantity = fuelQuantity;
- this.FuelConsumption = fuelConsumtpion;
- this.TankCapacity = tankCapacity;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement