Skip to content

Practice problems Unit 2 Pathway 1: Android Basics with Compose #220

Description

@xavier-d

In Section "Practice: Kotlin Fundamentals", on Solution page 9

The temperature "Temperature converter" exercice

In my opinion the close parenthesis should be after the lambda as it is part of function parameters

    printFinalTemperature(27.0, "Celsius", "Fahrenheit") { 9.0 / 5.0 * it + 32 }
    printFinalTemperature(350.0, "Kelvin", "Celsius") { it - 273.15 }
    printFinalTemperature(10.0, "Fahrenheit", "Kelvin") { 5.0 / 9.0 * (it - 32) + 273.15 }

should be

    printFinalTemperature(27.0, "Celsius", "Fahrenheit", { 9.0 / 5.0 * it + 32 })
    printFinalTemperature(350.0, "Kelvin", "Celsius", { it - 273.15 })
    printFinalTemperature(10.0, "Fahrenheit", "Kelvin", { 5.0 / 9.0 * (it - 32) + 273.15 })

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions