Swift Development for iOS – Swift Part 1 Homework 1 – Tasks


Homework 1

Fuel consumption calculator

  • Make function for calculating average fuel consumption in liters per 100 km
  • Make function that is used for adding distance and amount of fuel. Calculate average fuel consumption between the current and the last fueling
  • Make function for converting l/100km to mpg.
  • Make function for calculating the average price per kilometer on given fuel price per liter.
  • Consider that the tank is being filled from empty to full and the inputvalues are liters and kilometers.


Read More