1. Write code for a JOptionPane dialog that will ask whether the user is at
least 18 years of age. Then set the boolean variable adult equal to either
true, if the user is at least 18, or false otherwise. Include the declaration
of the variable adult.
2. Write a fragment of code that will test whether a float variable temperature
contains a valid, human body temperature. Valid human body temperatures
are in the range 96.0 to 106.0 degree Fahrenheit.
3. Write a fragment of code that will change the integer value stored in y as
follows. If y is even, multiply y by 4 then add 3. I f y is odd, multiply y by
5 and subtract 2.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here