Assignemnt #52 Fortune Cookie
Code
///Name: JJ Deng
///Period: 6
///Program Name: Fortune Cookie
///File Name: Cookie.java
///Date Finished: 12/2/15
import java.util.Random;
public class Cookie
{
public static void main (String[] args)
{
Random r = new Random();
int n = 1 + r.nextInt(6);
int n1 = 1 + r.nextInt(54);
int n2 = 1 + r.nextInt(54);
int n3 = 1 + r.nextInt(54);
int n4 = 1 + r.nextInt(54);
int n5 = 1 + r.nextInt(54);
int n6 = 1 + r.nextInt(54);
if (n == 1)
{
System.out.println("Your daughter is home alone");
System.out.println(" " + n1 + " - " + n2 + " - " + n3 + " - " + n4 + " - " + n5 + " - " + n6 );
}
else if (n == 2)
{
System.out.println("You will become a grandfather very soon");
System.out.println(" " + n1 + " - " + n2 + " - " + n3 + " - " + n4 + " - " + n5 + " - " + n6 );
}
else if (n == 3)
{
System.out.println("You will become a grandmother very soon");
System.out.println(" " + n1 + " - " + n2 + " - " + n3 + " - " + n4 + " - " + n5 + " - " + n6 );
}
else if (n == 4)
{
System.out.println("Your son isn't home and his gf's parents aren't home either");
System.out.println(" " + n1 + " - " + n2 + " - " + n3 + " - " + n4 + " - " + n5 + " - " + n6 );
}
else if (n == 5)
{
System.out.println("Calm Down");
System.out.println(" " + n1 + " - " + n2 + " - " + n3 + " - " + n4 + " - " + n5 + " - " + n6 );
}
else if (n == 6)
{
System.out.println("Calm Down");
System.out.println(" " + n1 + " - " + n2 + " - " + n3 + " - " + n4 + " - " + n5 + " - " + n6 );
}
}
}
Picture of the output