Assignment 56; ForCoo
Code
// Donovan Rich
// Period 6
// Fortune Cookie
// ForCoo.java
// 11/30/2015
import java.util.Random;
public class ForCoo
{
public static void main ( String[] args )
{
Random r = new Random();
int choice = 1 + r.nextInt(6), n1 = 1 + r.nextInt(54), n2 = 1 + r.nextInt(54), n3 = 1 + r.nextInt(54), n4 = 1 + r.nextInt(54), n5 = 1 + r.nextInt(54), n6 = 1 + r.nextInt(54);
String fortune = "";
if ( choice == 1 )
fortune = "| You're screwed.";
else if ( choice == 2 )
fortune = "| You are a winner!";
else if ( choice == 3 )
fortune = "| Ahahahahaha... Hahaha.";
else if ( choice == 4 )
fortune = "| You will receive a beta key.";
else if ( choice == 5 )
fortune = "| You forget how to even.";
else if ( choice == 6 )
fortune = "| FORTUNE.EXE IS NOT RESPONDING";
System.out.println( "+------------------------------------------" );
System.out.println( fortune );
System.out.println( "| " + n1 + " - " + n2 + " - " + n3 + " - " + n4 + " - " + n5 + " - " + n6 );
System.out.println( "+------------------------------------------" );
}
}
Picture of the output