> COMPUTER SCIENCE HELP~ JAVA CODE?

COMPUTER SCIENCE HELP~ JAVA CODE?

Posted at: 2014-12-18 
HOPE THIS MAY HELP YOU.....

public static void makeBox(String str)

{

String a=str;

for(int i=0;i<4;i++)

{

char ch=a.charAt(i);

if(i==0)

{

for(int j=0;j<4;j++)

{

System.out.print(ch);

}}

if(i==1)

{

for(int j=0;j<2;j++)

{

System.out.print(ch);

}}

if(i==2)

{

for(int j=0;j<2;j++)

{

System.out.print(ch);

}}

if(i==3)

{

for(int j=0;j<4;j++)

{

System.out.print(ch);

}}

System.out.println();

}

}

Take the word and go through it using a for loop assigning each character to a char variable. The use system.out.print to put the words where you want them:

System.out.print(" char1+char1+char1+char1+

char2+char2+

char3+char3+

char4+char4+char4+char4 ");

This will print something similar to your example. Comment back if it doesn't work or if you don't see what I am saying....