// Exercise 1 // // what does this program do? // try to anticipate what the output will be, // then key it in, compile it, run it and // verify your guess! // // note: keying in a program i tedious :/, but it is the // best possible exercise to "getting used" to syntax :) // // ... you don't need to copy the comments... // public class DemoBuiltins { public static void main(String[] a) { // define a few integer variables (type int), // assign values to them, // perform some operations and // output the result int an_int = 13; int another_int; another_int = 8; int result = (an_int + another_int) / 2; System.out.println(result); // do something similar using // floating point variables (type double) double a_number = 13; double y = 8; double r = (a_number + y) / 2; System.out.println(r); // int and double are built-in types // note that their names start with lower case letters! } }