void Start() { //We present some base cases (and then cross check the AllUnits output with Google) Inch MyHeight = new Inch(74); Meter ThreeMeters = new Meter(3); Mile DistanceToTheMoon = new Mile(238900); Foot ThreeFeet = new Foot(3); Debug.Log("MyHeight: " + MyHeight.AllUnits() + "\n"); Debug.Log("ThreeMeters: " + ThreeMeters.AllUnits() + "\n"); Debug.Log("DistanceToTheMoon: " + DistanceToTheMoon.AllUnits() + "\n"); Debug.Log("ThreeFeet: " + ThreeFeet.AllUnits() + "\n"); }
public MilesPerHour(Mile distance, Hour timeInterval) { MovementDistance = distance; TimeInterval = timeInterval; Value = MovementDistance.Value / TimeInterval.Value; }