Minggu, 08 April 2012

sample program JOption


import javax.swing. *;

public class {If_InputAngka1
            public static void main (String [] args) {

                        / / declaration of variables
                        int value;
                        String input = JOptionPane.showInputDialog ("Enter your score:");
                        value = Integer.parseInt (input);

                        / / declaration statement if the condition
                        if (value> = 60) {
                                    JOptionPane.showMessageDialog (null, "You Passed");
                                    {else}
                                                JOptionPane.showMessageDialog (null, "You Failed");
                                                }
                        }
            }

0 komentar

Posting Komentar

Statistik