Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Car
- {
- public string Model { get; set; }
- public decimal FuelAmount { get; set; }
- public decimal FuelConsumptionPerKm { get; set; }
- public decimal DistanceTraveled { get; set; }
- public bool CanTravel(decimal desiredDistance, decimal fuelAmount, decimal fuelConsumptionPerKm, decimal distanceTraveled)
- {
- if ((desiredDistance * fuelConsumptionPerKm) <= fuelAmount)
- {
- return true;
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement