Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2.
- /**
- *Homework problem pp 54-55 number 2
- *
- * @author William Shi
- * @version 9/5/2015 version #1)
- */
- public class Spikey
- {
- public static void main(String[] args)
- {
- System.out.println(" \\/") ;
- System.out.println(" \\\\//") ;
- System.out.println("\\\\\\///") ;
- System.out.println("///\\\\\\" );
- System.out.println(" //\\\\") ;
- System.out.println(" /\\") ;
- }
- }
- 4.
- /**
- * Homework Problem pp 54-55 #4
- *
- * @author William Shi
- * @version 9/5/2015 Version 1
- */
- public class Difference
- {
- public static void main(String [] args)
- {
- System.out.println("What is the difference between");
- System.out.println("a ' and \"? Or between a \" and a \\\"?");
- System.out.println();
- System.out.println("One is what we see when we're typing our program.\nThe other is what appears on the \"console\".");
- }
- }
- 6.
- /**
- * Homework Problem pp 54-55 #6
- *
- * @author William Shi
- * @version 9/5/2015
- */
- public class Meta
- {
- public static void main (String[] args)
- {
- System.out.println("A \"quoted\" String is \n'much' better if you learn \nthe rules of \"escape sequences.\"");
- System.out.println("Also, \"\" represents an empty String. \nDon't forget: use \\\" instead of \" ! \n' ' is not the same as \"");
- }
- }
- 8./**
- * Homework problem pp54-55 #8
- *
- * @author William Shi
- * @version 9/5/2015 v1
- */
- public class Stewie2
- {
- public static void Victory()
- {
- System.out.println("|| Victory is mine! ||");
- System.out.println("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\");
- }
- public static void main(String[] args)
- {
- System.out.println("//////////////////////");
- Victory();
- Victory();
- Victory();
- Victory();
- Victory();
- }
- }
- 10. * Homework Problem pp54-55 #10
- *
- * @author William Shi
- * @version 9/15/2015
- */
- public class Egg2
- {
- public static void Topegg()
- {
- System.out.println(" _______");
- System.out.println(" / \\");
- System.out.println("/ \\");
- }
- public static void Middleegg()
- {
- System.out.println("_\"_'_\"_'_\"_");
- }
- public static void Bottomegg()
- {
- System.out.println("\\ /");
- System.out.println(" \\_______/");
- }
- public static void main(String[] args)
- {
- Topegg();
- Bottomegg();
- Middleegg();
- Topegg();
- Bottomegg();
- Middleegg();
- Bottomegg();
- Topegg();
- Middleegg();
- Bottomegg();
- }
- }
- 11./**
- * Homework Problem pp 56-57 #11
- *
- * @author William Shi
- * @version 9/5/2015
- */
- public class TwoRockets
- {
- public static void cone()
- {
- System.out.println(" /\\ /\\ ");
- System.out.println(" / \\ / \\");
- System.out.println(" / \\ / \\");
- }
- public static void box()
- {
- System.out.println("+------+ +------+");
- System.out.println("| | | |");
- System.out.println("| | | |");
- System.out.println("+------+ +------+");
- }
- public static void main(String[] args)
- {
- cone();
- box();
- System.out.println("|United| |United|");
- System.out.println("|States| |States|");
- box();
- cone();
- }
- }
- 13./**
- * Homework Problem pp56-57 #13
- *
- * @author William Shi
- * @version 9/5/2015
- */
- public class StarFigures
- {
- public static void box()
- {
- System.out.println("*****");
- System.out.println("*****");
- }
- public static void x()
- {
- System.out.println(" * * ");
- System.out.println(" * ");
- System.out.println(" * * ");
- }
- public static void main(String[] args)
- {
- box();
- x();
- System.out.println("");
- System.out.println("");
- box();
- x();
- box();
- System.out.println("");
- System.out.println("");
- System.out.println(" * ");
- System.out.println(" * ");
- System.out.println(" * ");
- box();
- x();
- }
- }
- 14.
- /**
- * Homework problem 56-57 #14.
- *
- * @author William Shi
- * @version 9/5/2105
- */
- public class Lanterns
- {
- public static void trap()
- {
- System.out.println(" *****");
- System.out.println(" *********");
- System.out.println("*************");
- }
- public static void line()
- {
- System.out.println("* | | | | | *");
- }
- public static void main()
- {
- trap();
- System.out.println("");
- System.out.println("");
- trap();
- line();
- System.out.println("*************");
- trap();
- System.out.println("");
- System.out.println("");
- trap();
- System.out.println(" ***** ");
- line();
- line();
- System.out.println(" ***** ");
- System.out.println(" ***** ");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement