Assignemnt #56 and FortuneCookie
Code
/// Name: Yordan Rashkov
/// Period: 7
/// Program Name: FortuneCookie
/// File Name: FortuneCookie.java
/// Date Finished: 11/26/2015
import java.util.Random;
public class FortuneCookie
{
public static void main ( String[] args )
{
Random r = new Random();
int choice = 1 + r.nextInt(6);
String response = "";
if ( choice == 1 )
response = "Don't sell your car... 14 - 24 - 12 - 17 - 33 - 11";
else if ( choice == 2 )
response = "You should smile more... 33 - 13 - 32 - 21 - 17 - 31";
else if ( choice == 3 )
response = "Your life will soon be filled with happiness... 36 - 19 - 15 - 25 - 20 - 12";
else if ( choice == 4 )
response = "Try to make some friends, you will soon need them... 34 - 14 - 22 - 33 - 16 - 28";
else if ( choice == 5 )
response = "Listen to your wife more... 11 - 21 - 16 - 13 - 30 - 21";
else if ( choice == 6 )
response = "You will understand, but it will be too late... 13 - 12 - 34 - 24 - 17 - 22";
else
response = "SORRY! NO FORTUNE FOR YOU!";
System.out.println( "FORTUNE COOKIE SAYS: " + response );
}
}