CSCI 161 - Lab 1: "M-I Crooked Letter"

Overview

This lab is inspired by the children's song of the same name that has been learned by young students in order to help them spell the state name "Mississippi."

The objectives of this lab are to reinforce and help teach:

The problem your lab program will solve is that of printing to the screen ascii-art characters that spell out the word MISSISSIPPI.

What is 'Ascii Art?'
Ascii art is when you represent something, in this case larger text letters, using individual ascii characters.

For example, an Ascii-Art uppercase letter M can be printed using the following statements:

		System.out.println("M      M");
		System.out.println("MM    MM");
		System.out.println("M M  M M");
		System.out.println("M  MM  M");
		System.out.println("M      M");
		System.out.println("M      M");
		System.out.println("M      M");
		System.out.println("M      M");            
            

And an uppercase letter I can be printed using the following statements:

		System.out.println(" IIIIII");
		System.out.println("   II");
		System.out.println("   II");
		System.out.println("   II");
		System.out.println("   II");
		System.out.println("   II");
		System.out.println("   II");
		System.out.println(" IIIIII");
            

Note: Observe the padding (extra space) on the left and right of the letter I above. This is purposeful so that it utilizes 8 characters wide and is horizontal centered with the other letters when used to spell words vertically.

Notice how in the middle part of the I there is no trailing white space (extra spaces) after the II characters. The same should be done for your S and P characters…no trailing white spaces.

Instructions

Following are the instructions and you should follow them carefully:

  1. Using Eclipse create a new Java Project and name it: Lab1
  2. As with all your labs, add a class of the same name, Lab1, and include in that class a main method.
  3. In Lab1.java, above the main method, develop your own public static void methods, named appropriately, with each method drawing to the screen a different ascii art letter (one each for M, I, S and P).
    Note: Each letter should be 8 characters tall by 8 characters wide (center and pad with spaces on each side as needed) and constructed using the uppercase character of the letter being drawn (e.g. the letter M is drawn using the capital 'M' character).
  4. There should be a blank line between each vertical "letter" (hint: develop method that just prints a blank line.)
  5. Call your methods that draw the letters from within your main method so that your program spells out the word MISSISSIPPI.
  6. If you have developed a method for drawing each of the four characters and a method for rendering a blank line, then calling those methods within main should yield twenty-one (21) statements that when executed spell out MISSISSIPPI as in the output below.
  7. Iteratively develop the lab (get one method working, test it, fix syntax errors, continue on to the next).
  8. When the lab is complete and working submit your Lab1.java file via AutoLab.

Things to Consider & Remember

  1. Method names should have the proper camelCase.
  2. All of your methods (other than main) will be without parameters.
  3. Use proper indentation for your curly braces.
  4. All of your methods should be public, static and void.

Sample Output

Following is sample output:

M      M
MM    MM
M M  M M
M  MM  M
M      M
M      M
M      M
M      M

 IIIIII
   II
   II
   II
   II
   II
   II
 IIIIII

 SSSSSS
S      S
S
 SSSSSS
       S
       S
S      S
 SSSSSS

 SSSSSS
S      S
S
 SSSSSS
       S
       S
S      S
 SSSSSS

 IIIIII
   II
   II
   II
   II
   II
   II
 IIIIII

 SSSSSS
S      S
S
 SSSSSS
       S
       S
S      S
 SSSSSS

 SSSSSS
S      S
S
 SSSSSS
       S
       S
S      S
 SSSSSS

 IIIIII
   II
   II
   II
   II
   II
   II
 IIIIII

PPPPPPP
P      P
P      P
PPPPPPP
P
P
P
P

PPPPPPP
P      P
P      P
PPPPPPP
P
P
P
P

 IIIIII
   II
   II
   II
   II
   II
   II
 IIIIII
            
            

Deadline

This lab must be AutoLab submitted to the instructor by 11:59pm on the Monday a week after it was assigned. Check AutoLab for the specific due date.