public class TemperatureConvert { public static void main(String[] args) { double celcius, farenheit; //variable declarations farenheit = 100; //assignment statement celcius = (farenheit-32) * 5.0/9; //assignment statement with calculation System.out.println(farenheit + " degrees farenheit equals " + celcius + " degrees celcius."); //output //Notice how this (long) statement is split along two lines //to make it easier to read } //end main() method } //end TemperatureConvert class definition /* - Notice generous use of whitespace - An extra line is used to separate various segments of the program - E.g. variable declarations, assignment statements, output statements - On the assignment statement, notice how it is not formally 'right-to-left', but rather, right side first (using standard order of operations) - Obviously, the computer does not magically "know" the conversion from farenheit to celcius. We must provide it. - "Garbage in, garbage out" - If we replaced the - sign with a '+' sign, or forgot to use parentheses, we would be faced with a "logic error" (not a syntax error). - That is, the compiler would not complain, yet your program still would not work properly. */