Question: 2. It is said that Albert Einstein used to take great delight in baffling friends with the puzzle below: First, write the number 1089 on

2. It is said that Albert Einstein used to take great delight in baffling friends with the puzzle below: First, write the number 1089 on a piece of paper, fold it, and hand it to a friend for safekeeping. What you wrote down is not to be read until you have completed your amazing mental feat. Next, ask your friend to write down any three-digit number, emphasizing that the first and last digits must differ by at least two. Close your eyes or turn your back while this is being done. Better still, have someone blindfold you. After your friend has written down the three-digit number, ask him to reverse it, then subtract the smaller from the larger. Example: 654 - 456 = 198. Once this is done, tell your friend to reverse the new number. Example: 198 becomes 891. Next ask your friend to add the new number and its reverse together. Example: 198 + 891 = 1089. If all goes as planned, your friend will be amazed. The number you wrote down at the start -- 1089 -- will always be the same as the final result of this mathematical trick. Write a Java program to play Einsteins game as follows: Print a message to the user about the game and explain the rules Prompt the user for a 3-digit number as described Print out user number and the reverse of that number Print out the difference between the entered number and the reversed number. This should always be a positive number. Print the reverse of the difference Print the sum of the difference and the reversed difference. It should be 1089 for any 3-digit number ITSE 2417 S18 2 The answer must be calculated using the steps listed above. Do not use an array. Output should be user friendly. See: https://www.youtube.com/watch?v=ADMsA5qa0Uw

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!