Skip to Local Navigation
Skip to Content
Cal State Long Beach
Association for Computing Machinery » CSU Long Beach Student Chapter » Don’t steal my cookie
Print this page Add this page to your favorites Select a font size Select a small font Select a medium font Select a large font
 

Don’t steal my cookie

// Assume a variable “numOfCookie” exists and has a value”
/**NOTE: Indentations were not implemented due to formatting problems but that doesn’t mean
*that you don’t have to format!!
*
**/
final int AMOUNT_OF_COOKIES_I_SHOULD_HAVE = 1000;

String you;

if(numOfCookie == AMOUNT_OF_COOKIES_I_SHOULD_HAVE )

System.out.println("YAY, all of my cookies are still here!");

else if(numOfCookie > AMOUNT_OF_COOKIES_I_SHOULD_HAVE)

System.out.println("Wow, I got more cookies,  cool. ");

else

{

System.out.println("Thief! Give me back my cookies!");

you = "Thief that stole my cookies";

}

Comments

Get a Trackback link

No Comments Yet

You can be the first to comment!

Leave a comment