Kotlinlearncs.online LogoJava
Return to List

Homework: Two Magical Numbers

Created By: Nikita Neledov
/ Version: 2023.7.0

Consider a double value magical if it is strictly between 0 and 1. Given two double values first and second, write a snippet of code (not a method) to test whether first and second are both magical numbers. If they are, the program shall joyously exclaim (print) "True!" revealing their magical nature. Otherwise, it will print “False” encouraging you to seek the arcane secrets elsewhere.

Note that both first and second are already declared and initialized for you, and you should not modify their values.

Related Lessons

Stuck? You may find these lessons helpful: