public class Arithmetic { public static void main (String [] args) { // // Create an integer variable and set it to your // current age (in years) // // Display it // Divide your age by 2 and display that value // Add one to your age and divide that value by 2, display that value // What conclusion can you draw regarding integer division? // (put answer in a comment here) // Create a floating point (double) variable and set it to .1 // Write a statement that adds 10 of these variables you just declared // (do not multiply by 10....add up 10 instances of the variable) // e.g. double something = value + value etc // Display the result // Put the value that was displayed in a comment // // Integer values in java have a finite size. the maximum // integer value can be accessed using a variable that has // been declared in another class....the name of the variable // is Integer.MAX_VALUE // Declare an integer variable and set it to this (max) value. // Add one to it and then display it // repeat using Integer.MIN_VALUE (only subtract 1, of course) // Place the values that were displayed here: // max + 1 : // min - 1 : // // Set an integer variable to the result of the following integer calculation // and display the result ...what rule of // precedence is illustrated? // 14 + 8 / 2 // Display the result of this calculation and tell what // associativity rule you observe // 3 * 15 / 5 / 3 // Take a break // Create a double and store 3.77 in the variable // Create an integer and store 29 in it // Now assign the integer variable to the double variable // Now assign the double to the integer...what happens???? // Write some code that creates an integer variable that // contains some value for inches of cloth // Create a variable and assign the number of feet of cloth // Create a variable and assign the leftover inches (hint use %) // Create four (int or double) variables to hold two sets of x,y coordinates: // (x1,y1) and (x2,y2) // Calcuate the distance between the two points...use Math.sqrt(expression) // to do the square root part // (if you need help with the formula, ask your neighbor or a TA) } }