Swift Development for iOS – Swift Part 2 Homework 1 – Cooking Recipes

 

Task 1
Cooking Recipes

You are making an application for cooking recipes.
In your application you must have at least 3 recipes for different dishes.
You must have all the products for cooking in an enum. (e.g. enum Products with items – sugar, salt, pepper, banana etc.) . Do not forget that the recipes are sometimes consisting of few items with different amount of them (e.g. sugar – 100 gr, banana 2 pcs.). Create a function used for search of an item, and if the item is found the recipe must be printed.

Task 2
What I should buy ?

Consider the data from task 1. You must extend the application with functionality to have information about the product availability at your home. Make a function that checks if you have all the needed items in order to cook a dish. If no, make a function to print information about what products must be bought and how many (how much).

(more…)

Read More

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.

(more…)

Read More