Write code

Write a program that will tell how many inches and feet are in the number of inches in variable size.

import java.util.Scanner;
class Measurements {
   public static void main(String[] args){
      // read in number of inches
      Scanner scan = new Scanner(System.in);
      System.out.print("enter number of inches: ");
      int size = scan.nextInt( );
      
      // calculate number of feet and inches
      
      
      
      
      // output results
      
      
      
    }
}

Matching

  1. ___ all output in Java is of type
  2. ___ This type of statement: double d = 35.6;
  3. ___ change int x into a double in this equation: double avg = (y + ________ x)/2;
  4. ___ a method of the Scanner class to read in a number with a decimal
  5. ___ a valid variable name in Java
  6. ___ same as d = d + 1;
  7. ___ The reason why this is OK: double d = 8;
  8. ___ Type of variable to store decimal values.
  9. ___ Type of variable that uses 'a' single quote for the literal.
  1. char
  2. (double)
  3. double
  4. d++
  5. nextDouble
  6. dubble2
  7. assignment
  8. String
  9. widening cast

Calculate:

Given:
int a = 9;
double r = 4.5;
  1. a/5
  2. a % 3
  3. a +=2
  4. a = (int) r;