Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Zain Arfi
- Chapter 2 Exercises
- Page 130 Number 16
- public class Pg130_16
- {
- public static void main(String[] args)
- {
- for(int row=1; row<=6; row++)
- {
- for(int bs=1; bs<=(row*2-2); bs++)
- {
- System.out.println("\\");
- }
- for(int exc=1; exc<=(row*2-2); exc--)
- {
- System.out.println("!");
- }
- for(int fs=1; fs<=(row*2-2); fs++)
- {
- System.out.println("/");
- }
- System.out.println();
- }
- }
- }
- Page 131 20
- public class StarFigure
- {
- public static void main(String[] args)
- {
- for(int row=1; row<=4; row++)
- {
- for(int bs=1; bs<=(row*-4+20); bs++)
- {
- System.out.println("/");
- }
- for(int aster=1; aster<=(row*8-8); aster++)
- {
- System.out.print("*");
- }
- for(int fs=1; fs<=row*-4+20; fs++)
- {
- System.out.print("\\");
- }
- System.out.println();
- }
- }
- }
- Pg 131 22
- public class Pg130_14
- {
- public static void main(String[] args)
- {
- for(int row=1; row<=7; row++)
- {
- for(int star=row; star<=(row*2-2); row++)
- {
- System.out.println("*");
- }
- for(int money=row; money>=7; money--)
- {
- System.out.print("$");
- }
- for(int star2=row*2; star>=(row*7-2);star2++)
- {
- System.out.print("*");
- }
- for(int money=row; money>=7; money--)
- {
- System.out.print("$");
- }
- for(int star=row; star<=(row*2-2); row++)
- {
- System.out.println("*");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement