static void Main(string[] args) { //Console.WriteLine("Hello World!"); Car car = new Car(); car.GasLevel = 3.60f; //car.AddGas(10); Console.WriteLine("Gas Added: " + car.FillUp() + " units"); Console.ReadLine(); }
static void Main(string[] args) { Car car1 = new Car(); Console.WriteLine($"The starting fuel amount is: {car1.GasLevel}"); Console.Write("How much gas to add: "); car1.AddGas(float.Parse(Console.ReadLine())); Console.WriteLine($"The new gas amount is: {car1.GasLevel}"); Console.Write("Fill up..."); Console.ReadLine(); float gasDifference = car1.FillUp(); Console.WriteLine($"The gas difference is: {gasDifference}"); Console.WriteLine($"The final filled up amount is: {car1.GasLevel}"); Console.ReadLine(); }