The extraterrestrials living in the planet Numerion revere a specific type of integers N. In particular, for those creatures, an integer N is holy if there exists an integer i >= 1 such that:N = i*i + iHere are some examples of holy numbers:2 (because 2 = 1*1 + 1) 6 (because 6 = 2*2 + 2) 12 (because 12 = 3*3 + 3) In a file called Numerion.java, write a program that: Asks the user to enter an integer N. It is OK if your program crashes when the user does not enter a valid integer. Prints out whether that number is a holy number in planet Numerion. For example: if the user enters 25, your program output should look EXACTLY like this: Enter an integer N: 25 25 is not a holy number in Numerion. Exiting... As another example: if the user enters 12 (a holy number, since 12 = 3*3 + 3), your program output should look EXACTLY like this:Enter an integer N: 12 12 is a holy number in Numerion. Exiting...
The extraterrestrials living in the planet Numerion revere a specific type of integers N. In particular, for those creatures, an integer N is holy if there exists an integer i >= 1 such that:N = i*i + iHere are some examples of holy numbers:2 (because 2 = 1*1 + 1) 6 (because 6 = 2*2 + 2) 12 (because 12 = 3*3 + 3) In a file called Numerion.java, write a
- Asks the user to enter an integer N. It is OK if your program crashes when the user does not enter a valid integer.
- Prints out whether that number is a holy number in planet Numerion.
For example: if the user enters 25, your program output should look EXACTLY like this:
Enter an integer N: 25 25 is not a holy number in Numerion. Exiting... As another example: if the user enters 12 (a holy number, since 12 = 3*3 + 3), your program output should look EXACTLY like this:Enter an integer N: 12 12 is a holy number in Numerion. Exiting...
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 5 images