Question
I am having trouble with the output of this code, it is written in Kotlin. Every time I try to use it sends the error
I am having trouble with the output of this code, it is written in Kotlin. Every time I try to use it sends the error A 'return' expression required in a function with a block body ('{...}'). I am not sure what this means.
Here is the code (it takes in input from the user, the angle, and determines its positon)
fun compassDirection(angle: Double): Int { if(337.5<=angle && angle<=360) { return 1 } else if(292.5
fun main(args : Array
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started