Question: Using java, I need to write a program that creates a menu with the following choices: 1. Show Happy sequence for a number. 2. Show
Using java, I need to write a program that creates a menu with the following choices:
1. Show Happy sequence for a number.
2. Show all happy numbers in a range.
Example for part 1,
A happy number is a positive integer when the sum of the squares of the digits leads up to 1
Example 13 is happy since 1*1 + 3*3 = 10 and 1*1 + 0*0 = 1.
input 13000
output: 13000, 10, 1 - Happy
input: 643
output: 643, 61, 37, 58, 89, 145, 42, 20, 4, 16, 37 - Not Happy
For second part
The program should prompt the user to enter any two integers that will display all the happy numbers in a range. For example, It needs to look like this please. It asks the user for two numbers which the user inputs 1 and 1000 in the example below and displays all the happy numbers in between with .... to show empty spaces.

Number 1 1 Number 2 1000 Here are the happy numbers 10 19 28 3132 44 100 68.70 94 97 79 82 86 91 103 109 139 129130 133 167 188 190 1921 93 176 203 208 226 230 236 239 219 291.293 262263 280 3 01 302 329. 331 310 3 13 31 93 20 326 338 376 379 356 362 36 5.36 73 68 383 386 39 13 92 3 97 404 A 40 464 469 446 478 487 490 496 556 563 5655 66 536 608 617 6226 23 653 65 56 56 632 63 5. 637 638 644 649 665 671 700 694 709 683 716 680 673 748 739 761.763 736 8 02 790 793 806 784 847 836 860 863 8 18 820 833 899 901 904 907 888 881 874 93 1932 937 940 946 921.923 9 10.912913 989 973 998 970 964 Done
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
