Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 14-22 Even
- 14.public class Numbers
- {
- public static final int x=10;
- public static void main (String[] args)
- {
- for(int row=1; row<=4; row++)
- {
- for(int nine=1; nine<=x-1;nine++)
- {
- System.out.print("9");
- }
- for (int eight=1; eight<=x-2;eight++)
- {
- System.out.print("8");
- }
- for (int seven=1; seven<=x-3;seven++)
- {
- System.out.print("7");
- }
- for (int six=1; six<=x-4;six++)
- {
- System.out.print("6");
- }
- for (int five=1; five<=x-5;five++)
- {
- System.out.print("5");
- }
- for (int four=1; four<=x-6;four++)
- {
- System.out.print("4");
- }
- for (int three=1; three<=x-7; three++)
- {
- System.out.print("3");
- }
- for (int two=1; two<=x-8; two++)
- {
- System.out.print("2");
- }
- System.out.println("1");
- }
- }
- }
- 16.public class SlashFigures
- {
- public static void main(String [] args)
- {
- for(int row=1; row<=6; row++)
- {
- for(int bslash=1; bslash<=2*row; bslash++)
- {
- System.out.print("\\");
- }
- for(int Ex=1; Ex<=-4*row+26; Ex++)
- {
- System.out.print("!");
- }
- for(int fslash=1; fslash<=2*row; fslash++)
- {
- System.out.print("/");
- }
- System.out.println("");
- }
- }
- }
- 18.
- Draw a solid line
- Draw a Window
- Draw a solid line
- Draw a Window
- Draw a solid line
- solid line-
- write a plus sign on the output line
- write 3 equal signs on the output line
- write a plus sign on the output line
- write 3 equal signs on the output line
- write a plus sign on the output line( go to new line of output)
- Window-
- write a bar
- write 3 spaces
- write a bar
- write 3 spaces
- write a bar( go to new line of output)
- 20.public class StarFigure
- {
- public static void main(String[] args)
- {
- for(int row=1; row<= 5; row++)
- {
- for(int fslash=1; fslash<=-4*row+20; fslash++)
- {
- System.out.print("/");
- }
- for(int stars=1; stars<=8*row-8;stars++)
- {
- System.out.print("*");
- }
- for(int bslash=1; bslash<=-4*row+20; bslash++)
- {
- System.out.print("\\");
- }
- System.out.println("");
- }
- }
- }
- 22.
- public class DollarFigure
- {
- public static void main(String[] args)
- {
- for(int row=1; row<=7; row++)
- {
- for(int Star1=1; Star1<=2*row-2; Star1++)
- {
- System.out.print("*");
- }
- for(int Dollar1=1; Dollar1<=-1*row+8; Dollar1++)
- {
- System.out.print("$");
- }
- for(int Star2=1; Star2<=-2*row+16; Star2++)
- {
- System.out.print("*");
- }
- for(int Dollar2=1; Dollar2<=-1*row+8; Dollar2++)
- {
- System.out.print("$");
- }
- for(int Star3=1; Star3<=2*row-2; Star3++)
- {
- System.out.print("*");
- }
- System.out.println();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement