iOS Functions in Swift Adding Power to Functions Function Parameters

Nigel Matheson
PRO
Nigel Matheson
Pro Student 1,166 Points

not working for me

Not having much luck with this code.

Please help

functions.swift
// Enter your code below
func getRemainder(value a: int, divisor b: int) -> int {
return a % b

}

4 Answers

Nico Schmidt
Nico Schmidt
12,781 Points

You are almost there. You want to capitalise Int.

Luc Bernardin
Luc Bernardin
3,726 Points

Types in Swift always use upper camel case. Declaring a variable or constant of type string with i.e. let a: string will not work, in this case it would be declared with let a: String

Now apply this to your problem where you declare and return integers.

Nico Schmidt
Nico Schmidt
12,781 Points

Is it not how I said it? In your code example it is lower camel case.Am I missing the point?

Luc Bernardin
Luc Bernardin
3,726 Points

Yes Nico, i simply gave more explanation and more info on what was wrong and how to fix it without giving the answer straight away.

Nico Schmidt
Nico Schmidt
12,781 Points

Sorry, that is fine. I confused you with Nigel.