Question: C# Add n interface with a method to calculate the estimated distance the vehicle can travel with the existing fuel level. Create a list of
C#
Add n interface with a method to calculate the estimated distance the vehicle can travel with the existing fuel level. Create a list of Vehicles of various types (Car, Truck, Motorcycle) and assign different levels of fuel to them. Create a function that takes the Interface and the list of Vehicles and returns a list of distances to travel. Add an extension method to the Vehicle that determines if the vehicle is in need of repair e.g. bool IsRepairNeeded(...)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
