Question
Lab 03 Numbers Squared and Rotated! Objective: Write a program that prompts the user for a 4-digit whole number (we assume the users will enter
Lab 03
Numbers Squared and Rotated!
Objective:
Write a program that prompts the user for a 4-digit whole number (we assume the users will enter this correctly) and then displays it squared! No, not the mathematical squaring. This will make a square box of the numbers! WHOA! The top is the number, the left-hand side is the number but going down, the bottom is the number reversed, and the right hand side is the number going up. Also once the number is squared it is rotated clockwise by one space, and then again. HINT: While it seems like this should be stored as a numeric value (int or double) it may make more sense to store it as a String and use String methods.
Example Dialog:
Enter a 4-digit number
1234
The number squared is:
1234
2 3
3 2
4321
The number squared rotated clockwise one space is:
2123
3 4
4 3
3212
The number squared rotated clockwise again is:
3212
4 3
3 4
2123
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started