Created
February 14, 2013 05:41
-
-
Save danlangford/4950820 to your computer and use it in GitHub Desktop.
just some ideas around variables and functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package javaapplication1; | |
public class JavaApplication1 { | |
public static void main(String[] args) { | |
Integer sodasToday = 3, | |
sodasYesterday = 5, | |
totalSodas = sodasToday + sodasYesterday; | |
System.out.println("i drank "+ totalSodas +" sodas"); // this puts it on the screen | |
Integer cal = countCalories(totalSodas); | |
System.out.println("i had "+cal+" calories"); // this puts it on the screen | |
} | |
static Integer countCalories(Integer sodas) { | |
return sodas * 150; | |
} | |
} // end class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment