Assignment 56
code
///Name: Mutsu Osoegawa
///Period: 7
///Project Name: Fortune Cookie
///File Name: FortuneCookie.java
///Date: 11/5/2015
import java.util.Random;
public class FortuneCookie
{
public static void main( String[] args )
{
Random r = new Random();
int fortuneNumber;
fortuneNumber = 1 + r.nextInt(6);
if ( fortuneNumber == 1 )
{
System.out.println( "You will become loaded with cash." );
}
else if ( fortuneNumber == 2 )
{
System.out.println( "Good things will happen if you work hard. " );
}
else if ( fortuneNumber == 3 )
{
System.out.println( "The thing you most seek will come true. " );
}
else if ( fortuneNumber == 4 )
{
System.out.println( "You will earn a promotion by the end of this month. " );
}
else if ( fortuneNumber == 5 )
{
System.out.println( "An A in English will not be possible this year, but utilize that class to excel in other areas. " );
}
else if ( fortuneNumber == 6 )
{
System.out.println( "A good day is predicted tomorrow. " );
}
System.out.print( "\t" + 1 + r.nextInt(54) );
System.out.print( " - " + 1 + r.nextInt(54) );
System.out.print( " - " + 1 + r.nextInt(54) );
System.out.print( " - " + 1 + r.nextInt(54) );
System.out.println( " - " + 1 + r.nextInt(54) );
}
}