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

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!