Assignment 3

Homework - Lesson 1.6

Due 9/3/2014

Name:


1. What series of println statements would produce the following output:


“Several slashes are sometimes seen,”
said Sally.  “I’ve said so.”  See?
\  /


2. Write a println statement that produces the following output:


/ \ // \\ /// \\\


3. Name the four errors in the following program:


public class SecretMessage {
public static main (string[] args) {
System.out.println (“Speak friend”);
System.out.println (“and enter);
}


4. Name the four errors in the following program:


public class FamousSpeech
public static void main (String []) {
System.out.println (“Four score and seven years ago,”);
System.out.println (“our fathers brought forth on”);
System.out.println (“this continent a new nation”);
System.out.println (“conceived in liberty,”);
System.out.println (“and dedicated to the proposition”);
System.out.println (“that”);        /* this part should
System.out.println (“all”);      really say,
System.out.println (“men”);      “all PEOPLE!” */
System.out.println (“are”;
System.out.println (“created”);
System.out.println (“equal”);
}
}


Extra Credit:


Write a complete Java program called ‘Stewie’ that prints the following output:


/////////////////////////
|| Victory is mine! ||

\\\\\\\\\\\\\\\\\\\\\\\\\

No comments:

Post a Comment