oViE'
Tuesday, November 18, 2008
Tugas algo_4
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package pertemuan4;
import javax.swing.*;
/**
*
* @author ovie
*/
public class Tugas_4 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
String input;
int angka;
input = JOptionPane.showInputDialog(”Masukan Angka”);
angka = Integer.parseInt(input);
if (angka > 0){
int hitung = (angka % 2);
String keterangan = (hitung == 0)?”Bilangan Genap”:”Bilangan Ganjil”;
JOptionPane.showMessageDialog(null,”Keterangan = ” +keterangan);
}
// TODO code application logic here
}
}
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package pertemuan4;
import javax.swing.*;
/**
*
* @author ovie
*/
public class Tugas_4 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
String input;
int angka;
input = JOptionPane.showInputDialog(”Masukan Angka”);
angka = Integer.parseInt(input);
if (angka > 0){
int hitung = (angka % 2);
String keterangan = (hitung == 0)?”Bilangan Genap”:”Bilangan Ganjil”;
JOptionPane.showMessageDialog(null,”Keterangan = ” +keterangan);
}
// TODO code application logic here
}
}
0 Comments:
Post a Comment
<< Home