Skip to content

Instantly share code, notes, and snippets.



Created Aug 18, 2019
What would you like to do?
fun quote(width: Double, length: Double, pricePerSqrMtr: Double, roundUp: Boolean): Double {
return carpetPrice(pricePerSqrMtr, roundUp, roomArea(width, length))
fun carpetPrice(pricePerSqrMtr: Double, roundUp: Boolean, area: Double): Double {
val areaToPrice = if (roundUp) {
} else {
return pricePerSqrMtr * areaToPrice
fun roomArea(width: Double, length: Double): Double {
return width * length
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment