PROGRAMMING AND CODE
Assignemnt #56
Code
/// Name: Justin Li /// Period 7 /// Program Name: cookie /// File Name: cookie.java /// Date Finished: 12/2/15 import java.util.Random; class cookie { public static void main ( String[] args ) { Random r = new Random(); int cook = 1 + r.nextInt(6); String cookie; if ( cook == 1 ) { cookie = "It is much easier to look for the bad, than it is to find the good."; System.out.println( "Fortune cookie says: " + cookie ); } else if ( cook == 2 ) { cookie = "The cure for grief is movement."; System.out.println( "Fortune cookie says: " + cookie ); } else if ( cook == 3 ) { cookie = "Find a peaceful place where you can make plans for the future."; System.out.println( "Fortune cookie says: " + cookie ); } else if ( cook == 4 ) { cookie = "Our deeds determine us, as much as we determine our deeds."; System.out.println( "Fortune cookie says: " + cookie ); } else if ( cook == 5 ) { cookie = "To courageously shoulder the responsibility of one's mistake is character."; System.out.println( "Fortune cookie says: " + cookie ); } else if ( cook == 6 ) { cookie = "Let your imagination wander."; System.out.println( "Fortune cookie says: " + cookie ); } System.out.println("\n" + (1 + r.nextInt(54)) + " - " + (1 + r.nextInt(54)) + " - " + (1 + r.nextInt(54)) + " - " + (1 + r.nextInt(54)) + " - " + (1 + r.nextInt(54)) + " - " + (1 + r.nextInt(54))); } }