Ad
  • Custom User Avatar

    Okay great, thank you!

  • Custom User Avatar

    Check the function definition clicking reset:

    func bmi(_ weight: Int, _ height: Double) -> String {
    

    Leave it like that, do the casting inside it.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Hello!

    I was able to work out the solution in Playgrounds, but seem to keep running into an error when I attempt the test here. The error is as follows:

    main.swift:25:56: error: cannot convert value of type 'Int' to expected argument type 'Double'
    XCTAssertEqual(solution(weight, height), bmi(weight, height))
    ^~~~~~
    Double( )

    Any idea why I am getting this error message?

    Thank you!