Scally is newbie programmer. She tries to entertain herself with some astronomy. She started writing a program that prints true if the three input lines are real planets of the Solar system and false otherwise. Finish her program.
Introduction to collections
Planets game
Report a typo
Sample Input 1:
Mercury
Venus
EarthSample Output 1:
trueWrite a program in Scala 3
object PlanetsGame extends App {
val set = Set("Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune")
val first = scala.io.StdIn.readLine()
val second = scala.io.StdIn.readLine()
val third = scala.io.StdIn.readLine()
println(set(???) && ???)
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.