Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Swift Functions and Optionals Optionals Review: Functions

boris said
boris said
3,607 Points

I don't know what to do

Am I meant to make to separate functions or am I meant to make one? I did what it asked and it still says it's not meeting the requirements.

divisible.swift
func isDivisible(#dividend: Int, #divisor: Int) -> Bool {
    if dividend % divisor == 0 {
        return true
    } else {
        return false
    }
}



func isNotDivisble(#dividend: Int, #divisor:Int) -> Bool {
    var status = false
    if dividend % divisor == 0 {
        status = false
        println("Is not divisble")
    } else {
        status = true
        println("Is Divisble")
    }






return status


}


isNotDivisble(dividend: 10, divisor: 2)
Gabe Nadel
seal-mask
.a{fill-rule:evenodd;}techdegree
Gabe Nadel
Treehouse Guest Teacher

Hey Boris,

In the future, if you can write a title that is more descriptive than "I don't know what to do" that would help future students discover your valuable question when they stumble and search for a similar solution.

Cheers and thanks for being apart of The Community!

1 Answer

Raul Tammesalu
Raul Tammesalu
2,348 Points

Seems you might have a typo in function name: it should be isNotDivisible ( 4 x i ). Otherwise function looks correct.