Fortune.java



/** 占いのメッセージを表示するクラス Fortune
 *  @version1.0 06/01/00 
 */
public class Fortune {

    /** 最初に実行されるメソッド */
    public static void main( String[] argv ) {

        double value = Math.random();

        if( value > 0.8 ) {
             System.out.println( "Today, you are very lucky!" );
        }
        else if( value > 0.5 ) {
             System.out.println( "Today, you are lucky!" );
        }
        else if( value > 0.2 ) {
            System.out.println( "Today, you are unlucky!" );
        }
        else {
            System.out.println( "Today, you are very unlucky!" );
        }
    }
}