Assignemnt #56 Fortune Cookie
Code
///Name: Joshua Pell
///Period: 6
///Project Name: Fortune Cookie
///File Name: Cookie.java
///Date: 12/3/2015
import java.util.Random;
public class Cookie
{
public static void main( String[] args)
{
Random r = new Random();
int n1 = (1+ r.nextInt(6));
if (n1 == 1)
{
System.out.println("Stick with your wife");
System.out.println((1+ r.nextInt(54))+" - "+(1+ r.nextInt(54))+" - "+(1+ r.nextInt(54))+" - "+(1+ r.nextInt(54))+" - "+(1+ r.nextInt(54))+" - "+(1+ r.nextInt(54)));
}
if (n1 == 2)
{
System.out.println("You should not eat this fortune cookie");
System.out.println((1+ r.nextInt(54))+" - "+(1+ r.nextInt(54))+" - "+(1+ r.nextInt(54))+" - "+(1+ r.nextInt(54))+" - "+(1+ r.nextInt(54))+" - "+(1+ r.nextInt(54)));
}
if (n1 == 3)
{
System.out.println("You deserve better");
System.out.println((1+ r.nextInt(54))+" - "+(1+ r.nextInt(54))+" - "+(1+ r.nextInt(54))+" - "+(1+ r.nextInt(54))+" - "+(1+ r.nextInt(54))+" - "+(1+ r.nextInt(54)));
}
if (n1 == 4)
{
System.out.println("Don't");
System.out.println((1+ r.nextInt(54))+" - "+(1+ r.nextInt(54))+" - "+(1+ r.nextInt(54))+" - "+(1+ r.nextInt(54))+" - "+(1+ r.nextInt(54))+" - "+(1+ r.nextInt(54)));
}
if (n1 == 5)
{
System.out.println("Do it");
System.out.println((1+ r.nextInt(54))+" - "+(1+ r.nextInt(54))+" - "+(1+ r.nextInt(54))+" - "+(1+ r.nextInt(54))+" - "+(1+ r.nextInt(54))+" - "+(1+ r.nextInt(54)));
}
if (n1 == 6)
{
System.out.println("That meal was cat");
System.out.println((1+ r.nextInt(54))+" - "+(1+ r.nextInt(54))+" - "+(1+ r.nextInt(54))+" - "+(1+ r.nextInt(54))+" - "+(1+ r.nextInt(54))+" - "+(1+ r.nextInt(54)));
}
}
}
Picture of the output