Skip to content

Instantly share code, notes, and snippets.

@LOCOSP
Created October 15, 2018 00:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LOCOSP/c0f76eeb94aac3790147c622261fa368 to your computer and use it in GitHub Desktop.
Save LOCOSP/c0f76eeb94aac3790147c622261fa368 to your computer and use it in GitHub Desktop.
learn programming :)
func getMilk(howManyMilkCartond : Int, howMuchMoneyRobotWasGiven : Int) -> Int {
print("go to the shops")
print("buy \(howManyMilkCartond) cartons of milk")
let priceToPay = howManyMilkCartond * 2
print("pay \(priceToPay) dolars")
print("come home")
let change = howMuchMoneyRobotWasGiven - priceToPay
return change
}
//callin the getMilk function
var amountOfChange = getMilk(howManyMilkCartond: 13, howMuchMoneyRobotWasGiven: 50)
print("I'm back Borys and here is Your \(amountOfChange) dolars change.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment