/*
* HelloWorld.java
*
* Created on October 15, 2010, 7:01 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
/**
*
* @author praktikum
*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class alpro1 {
private static int Data;
@SuppressWarnings("empty-statement")
public static void main (String [] args)
{
BufferedReader bfr =new BufferedReader
(new InputStreamReader (System.in));
String menuInput =null;
do {
System.out.println("================================================");
System.out.println("Menu");
System.out.println("************************************************");
System.out.println("1. Menampilkan Hello World");
System.out.println("2. Menampilkan input dari user dalam huruf kapital");
System.out.println("3. Keluar");
System.out.println("================================================");
System.out.println("Masukkan Pilihan : ");
try {
menuInput = bfr.readLine();
} catch (IOException e)
{e.printStackTrace();
}
int Data = Integer.valueOf(menuInput).intValue();
if (Data == 1){
System.out.print("Menampilkan HELLOWORLD");}
if (Data == 2){
System.out.println("Masukkan Kata yang Anda Inginkan : ");}
String input = null;
try {
input = bfr.readLine();
} catch (IOException ex) {
ex.printStackTrace();
}
input= input.toUpperCase();
System.out.println (input);
if (Data == 3){
System.exit(0);}
else
System.out.println("Mohon Input Sesuai Menu List - Terima Kasih");
}
while (Data!=3);
}
}
No comments:
Post a Comment