Skip to content

Dwashi2/swift-TheFarmProblem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

swift-TheFarmProblem


Swift Study

Project to study Swift

Table of Contents
  1. About The Project
  2. Getting Started
  3. Contact

About The Project

  In this challenge, a farmer is asking you to tell him how many legs can be counted among all his animals. 
  The farmer breeds three species:
  chickens = 2 legs
  cows = 4 legs
  pigs = 4 legs
  
  The farmer has counted his animals and he gives you a subtotal for each species.
  You have to implement a function that returns the total number of legs of all the animals.
  
  Examples:
  animals(2, 3, 5) ➞ 36
  animals(1, 2, 3) ➞ 22
  animals(5, 2, 8) ➞ 50
  
  Notes:
  Don't forget to return the result.
  The order of animals passed is animals(chickens, cows, pigs).
  Remember that the farmer wants to know the total number of legs and not the total number of animals.

  Excercise from: https://edabit.com/challenges/swift

Getting Started

Open the file TheFarmProblem.xcodeproj

Prerequisites

  • Xcode 12.4
  • Use iPhone 12 mini as simulator

Contact

Daniel Washington Ignacio - danielvertigo@hotmail.com

Click to access my LinkedIn

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages