Built-in Ex: Trig, Booleans and Xor

Built-in Ex 7 and 8:

7a. Write a program that uses Math.sin() and Math.cos() to check that the value of sin^2(θ) + cos^2(θ) is approximately 1 for any θ entered as a command-line argument. Just print the value. Why are the values not always exactly 1?

7b. Suppose that a and b are boolean values. Simplify the following expression: (!(a && b))

  1. The exclusive or operator ^ for boolean operands is defined to be true if they are different, false if they are the same. Give a truth table for this function