WAP to print your name pattern !
NO COPYING ANSWERS
Answers
CODE :
import java.util.*;
class pattern_JISHNU
/*I wanna name myself "For loop maniac"
* LOL
*/
{
public void main()
{
Scanner sc=new Scanner(System.in);
System.out.println("How big you wanna see my name...enter a number more than 1 and less than 10");
System.out.println("If you enter less than 2 or more than 9 u will get an error dont blame me that time");
int n=sc.nextInt();
if(n>1&&n<10)
{
for(int i=1;i<=3;i++)
{
System.out.println();
}
System.out.println("Here is my humble name with no fame ...............");
for(int i=1;i<=3;i++)
{
System.out.println();
}
for(int i=1;i<=3;i++)
{
System.out.print(" ");
}
for(int i=1;i<=5;i++)
{
System.out.print("J ");
}
for(int i=1;i<=3;i++)
{
System.out.print(" ");
}
for(int i=1;i<=5;i++)
{
System.out.print("I ");
}
for(int i=1;i<=3;i++)
{
System.out.print(" ");
}
for(int i=1;i<=5;i++)
{
System.out.print("$ ");
}
for(int i=1;i<=3;i++)
{
System.out.print(" ");
}
System.out.print("H ");
for(int i=1;i<=10;i++)
{
System.out.print(" ");
}
System.out.print("H ");
for(int i=1;i<=3;i++)
{
System.out.print(" ");
}
for(int i=1;i<=5;i++)
{
System.out.print("N ");
}
for(int i=1;i<=3;i++)
{
System.out.print(" ");
}
System.out.print("U ");
for(int i=1;i<=10;i++)
{
System.out.print(" ");
}
System.out.print("U ");
System.out.println();
for(int j=1;j<=n/2;j++)
{
for(int i=1;i<=3;i++)
{
System.out.print(" ");
}
for(int i=1;i<=4;i++)
{
System.out.print(" ");
}
System.out.print("J ");
for(int i=1;i<=11;i++)
{
System.out.print(" ");
}
System.out.print("I ");
for(int i=1;i<=7;i++)
{
System.out.print(" ");
}
System.out.print("$ ");
for(int i=1;i<=11;i++)
{
System.out.print(" ");
}
System.out.print("H ");
for(int i=1;i<=10;i++)
{
System.out.print(" ");
}
System.out.print("H ");
for(int i=1;i<=3;i++)
{
System.out.print(" ");
}
System.out.print("N ");
for(int i=1;i<=6;i++)
{
System.out.print(" ");
}
System.out.print("N ");
for(int i=1;i<=3;i++)
{
System.out.print(" ");
}
System.out.print("U ");
for(int i=1;i<=10;i++)
{
System.out.print(" ");
}
System.out.print("U ");
System.out.println();
}
for(int i=1;i<=3;i++)
{
System.out.print(" ");
}
for(int i=1;i<=4;i++)
{
System.out.print(" ");
}
System.out.print("J ");
for(int i=1;i<=11;i++)
{
System.out.print(" ");
}
System.out.print("I");
for(int i=1;i<=5;i++)
{
System.out.print(" ");
}
for(int i=1;i<=3;i++)
{
System.out.print(" ");
}
for(int i=1;i<=5;i++)
{
System.out.print("$ ");
}
for(int i=1;i<=3;i++)
{
System.out.print(" ");
}
System.out.print("H ");
for(int i=1;i<=6;i++)
{
System.out.print("H ");
}
for(int i=1;i<=3;i++)
{
System.out.print(" ");
}
System.out.print("N ");
for(int i=1;i<=6;i++)
{
System.out.print(" ");
}
System.out.print("N ");
for(int i=1;i<=3;i++)
{
System.out.print(" ");
}
System.out.print("U ");
for(int i=1;i<=10;i++)
{
System.out.print(" ");
}
System.out.print("U ");
System.out.println();
for(int j=1;j<=n/2;j++)
{
for(int i=1;i<=3;i++)
{
System.out.print(" ");
}
for(int i=1;i<=4;i++)
{
System.out.print(" ");
}
System.out.print("J ");
for(int i=1;i<=11;i++)
{
System.out.print(" ");
}
System.out.print("I ");
for(int i=1;i<=15;i++)
{
System.out.print(" ");
}
System.out.print("$ ");
for(int i=1;i<=3;i++)
{
System.out.print(" ");
}
System.out.print("H ");
for(int i=1;i<=10;i++)
{
System.out.print(" ");
}
System.out.print("H ");
for(int i=1;i<=3;i++)
{
System.out.print(" ");
}
System.out.print("N ");
for(int i=1;i<=6;i++)
{
System.out.print(" ");
}
System.out.print("N ");
for(int i=1;i<=3;i++)
{
System.out.print(" ");
}
System.out.print("U ");
for(int i=1;i<=10;i++)
{
System.out.print(" ");
}
System.out.print("U ");
System.out.println();
}
for(int i=1;i<=3;i++)
{
System.out.print(" ");
}
for(int i=1;i<=3;i++)
{
System.out.print("J ");
}
for(int i=1;i<=7;i++)
{
System.out.print(" ");
}
for(int i=1;i<=5;i++)
{
System.out.print("I ");
}
for(int i=1;i<=3;i++)
{
System.out.print(" ");
}
for(int i=1;i<=5;i++)
{
System.out.print("$ ");
}
for(int i=1;i<=3;i++)
{
System.out.print(" ");
}
System.out.print("H ");
for(int i=1;i<=10;i++)
{
System.out.print(" ");
}
System.out.print("H ");
for(int i=1;i<=3;i++)
{
System.out.print(" ");
}
System.out.print("N ");
for(int i=1;i<=6;i++)
{
System.out.print(" ");
}
System.out.print("N ");
for(int i=1;i<=3;i++)
{
System.out.print(" ");
}
for(int i=1;i<=7;i++)
{
System.out.print("U ");
}
System.out.println();
}
else
{
System.out.println("ERROR:-Next time enter something more than 1 and less than 10 to see my name pattern");
System.out.println(";-) I value my name neither less than two nor more than nine ;-)");
}
}
}
Hope it helps :-)
Took 2 hours ;-)
_________________________________________________________