I am trying to solve some assignments in C#(MS Visual Studio) and would be grateful for some guidance. I will "paraphrase" the logic as below:
class Vehicle
{
public int Property{get {return Fuel}
set{ if TwoWheeler child called property then set max = 10
else(other alternate is FourWheeler child) max = 50}
}
class TwoWheeler : Vehicle
{ }
class FourWheeler : Vehicle
{}
class Program
{
TwoWheeler TwoWheeler_object = new TwoWheeler();
FourWheeler FourWheeler_object = new FourWheeler();
CW(TwoWheeler_object.Property);
CW(FourWheeler_object.Property);
}
This is the basic skeleton version of the code. If any clarifications needed, would be happy to do so. Thank you for the help in advance.
EDITED
The Property is set if the TwoWheeler called Property then the maxLimit=10 and if given Fuel is less than maxLimit then Fuel = value and if Fuel is greater or equal to maxLimit then Fuel = maxLimit
If FourWheeler called Property from Vehicle then maxLimit=50 then rest is the same