/* Solutions to Project 4 Question 1
 */
public class Calculator {

 public static void main(String[] args) {
  
  System.out.println("a: " + (117+31)*11);
  System.out.println("b: " + 37/17);
  System.out.println("c: " + 37.0/17);

  // The remainder of 74.23/6.28
  System.out.println("d: " + 74.23%6.28);
  
  // The quotient of 34/13
  System.out.println("e: " + 34/13);
  
  // The remainder of -87/9
  System.out.println("f: " + -87%9);
  
  // Find the quotient (integer) for 74.23/6.28. Hint: use casting.
  System.out.println("g: " + (int)(74.23/6.28));
  
  // The result of evaluating â€œ23 is greater than 11 and less than 45â€?.
  System.out.println("h: " + (23>11 && 23<45));
  
  // The result of evaluating â€œ22 is not equal to 5â€?.
  System.out.println("i: " + (2*2 != 5));
  
  // Evaluate the expression â€œ(sqrt(37.001))^2 is equal to 37.001â€? 
  // (To do this you may use Math.sqrt but not Math.pow)
  System.out.println("j: " + ((Math.sqrt(37.001)*Math.sqrt(37.001)) == 37.001));
  
  // The bigger value between 2^20 and 3^12
  System.out.println("k: " + Math.max(Math.pow(2,20), Math.pow(3,12)));
  
  // Evaluate the expression sin(PI/4)^2 + cos(PI/4)^2
  System.out.println("l: " + (Math.sin(Math.PI/4) * Math.sin(Math.PI/4)
          + Math.cos(Math.PI/4) * Math.cos(Math.PI/4)));

  // Generate a random integer on the interval [âˆ’1, 12]
  System.out.println("m: " + (int) Math.floor((Math.random()*13) - 1));
  
  // Randomly print one letter from the set {â€˜aâ€™, â€˜bâ€™, â€˜câ€™, â€˜dâ€™, â€˜eâ€™}. The
  // probability of each letter should be equal.) (Use Math.random)
  System.out.println("n: " + (char)((int) Math.floor(Math.random()*5)+'a'));
 }
}
