Source Code :
public class Bingkai{
public static void main (String [] str){
String nama;
int panjang;
System.out.print("\nNAMA : ");
nama = System.console().readLine();
panjang = nama.length() + 4;
System.out.println("");
System.out.print("+");
for(int i = 0; i < panjang + 4; i++){
System.out.print("=");
}
System.out.println("+");
System.out.print("| ");
System.out.print("+");
for(int i = 0; i < panjang; i++){
System.out.print("=");
}
System.out.print("+");
System.out.println(" |");
System.out.println("| | " + nama + " | |");
System.out.print("| +");
for(int i = 0; i < panjang; i++){
System.out.print("=");
}
System.out.print("+");
System.out.println(" |");
System.out.print("+");
for(int i = 0; i < panjang + 4; i++){
System.out.print("=");
}
System.out.println("+");
System.out.println("");
}
}
Outputnya :
Sunday, 7 September 2014
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment