creation: 08/01/99; revised 06/01/00, 05/12/03, 01/14/06


Fill in the Blanks

Instructions:   This is an ungraded fill-in-the-blank exercise. Each question consists of a sentence with one or two words left out. A button represents the missing word(s). For each question, think of the word or phrase that should fill each blank, then click on the buttons to see if you are correct. No grade is calculated for this exercise.


This exercise reviews Java input and output of floating point numbers.

1.   Both data type long and data type use 64 bits.

2.   Although they have the same number of bits the used in long and double are completely different.

3.   It is usually best to use what floating point type?

4.   Input from the keyboard is always which are read in by the Scanner and then to a numeric type.

5.   The reserved word is used to say that value in a variable will not change.

6.   Most math functions, like sine and cosine, are methods in the class.

7.   Most math function expect arguments of what type ?

8.   Most trig function expect angles to be expressed in

9.   Examine the following program which reads in a number and writes the sine of the number to the monitor. Fill in the blanks.

 java.util.Scanner ;  
class Trig
{  
  public static void main (String[] args)
  {
    Scanner scan = Scanner( System.in );  
 
    double angle, sineAngle; 
    System.out.println("Enter the angle:"); 
   
    angle = scan. 
 
    sineAngle = Math.( angle ); 
 
    System.out.println("The sine of " + angle + " is " + sineAngle );  
  }
}

10.   If the characters "1x23" were entered as data for the above program, it would throw an


End of the Exercise. If you want to do it again, click on "Refresh" in your browser window. Click here to go back to the main menu.