Lab 1: ARTISTIC COW!

(05-8-2002 to 08-8-2002)


This will be your first JAVA program. The main intent of this lab is to familiarize you with the BlueJ based JAVA compilation process.

The objective of this program is to draw some cows on the screen. These cows are in "ASCII Art" - where normal screen characters are used to create artistic objects. It is a generalization of the "Hello, World" program.

All you have to do is to use the method System.out.println() to generate each line of the cow.

For example:

System.out.println("*        (__)"); 

generates
* (__)

and

System.out.println("\\ (oo)");
generates
\ (oo)
If you observe you will notice that the second System.out.println() has two consecutive backslashes (\) but the output contains just one.

That is because the '\' is used as an escape character. In other words, to print few special characters like (") and (\), you need to append an extra '\' before each such character in the System.out.println().

Got the idea? Now go ahead and define four different methods. Each method should generate one of the following.
Also give meaningful names to the methods like walking_cow(),running_cow() etc.,


For Extra Credit : Define a method which takes arguments for the tail, the eye, the rear leg and the front leg - to define different "cow" models. Use it to generate some of the models and also combinations thereof.

	   
  *	   (__)
   \       (oo)
    \-------\/
    /|      |\
   //||----||\\
   ~ ~~    ~~ ~
    Cow walking


          (__)
          (oo)
   /-------\/
  / \      /
 *   \\--//
      ~  ~
    Cow running


          (__)
          (oo)
   /-------\/
  / \      \
 *   \\----\\
      ~     ~
    Cow braking


           (__)
           (--) 
     /------\/
    /|     ||
   * ||----||
     ~~    ~~
    Cow after pulling 
       a night-out


At the end, define your own method called my_cow() to generate "any" other posture of the cow.
For example: winking cow, flying cow, holy cow, student cow,...

IMPORTANT: After completing this code, pls show it to your tutor or one of the TAs, who will note it down on the register as completed.


NOTE: You may find the syntax examples from Lecture 3 useful for this lab.

HAVE FUN!