Lab 05

Numbers Squared!

 

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 silly goose.  This will make a square box of the number!  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.

 

Example Dialog:

 

Enter a 4 digit number

1234

1234

2  3

3  2

4321

 

Lab Report Questions:

  1. In order to get the 5th letter in a String variable then what method and parameter(s) needs to be called?
  2. In order to get the smaller String that ranges from the 3rd letter to the 8th letter, then what method and parameter(s) need to be called?

Finally:

Upload the .java file to the dropbox