Advertisement
RazorBlade57

Inputs - Chris

Sep 26th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.55 KB | None | 0 0
  1. import java.util.Scanner;  //used to track keystrokes
  2.  
  3. import javax.swing.JOptionPane;
  4. public class Input
  5. {
  6.    public static void main ( String[] args )
  7.    {
  8.  
  9.        
  10.  
  11.        Scanner keyboard = new Scanner(System.in);
  12.  
  13.        int intOne;
  14.  
  15.        int intTwo;
  16.        
  17.        double d1;
  18.        
  19.        double d2;
  20.        
  21.        float f1;
  22.        
  23.        float f2;
  24.        
  25.        short s1;
  26.        
  27.        short s2;
  28.  
  29.        System.out.print("Enter an integer :: ");
  30.  
  31.        intOne = keyboard.nextInt();
  32.  
  33.        System.out.print("Enter an integer :: ");
  34.  
  35.        intTwo = keyboard.nextInt();
  36.  
  37.        System.out.print("Eneter a double :: ");
  38.        
  39.        d1 = keyboard.nextInt();
  40.        
  41.        System.out.print("Enter a double :: ");
  42.        
  43.        d2 = keyboard.nextInt();
  44.        
  45.        System.out.print("Enter a float :: ");
  46.        
  47.        f1 = keyboard.nextInt();
  48.        
  49.        System.out.print("Enter a float :: ");
  50.        
  51.        f2 = keyboard.nextInt();
  52.        
  53.        System.out.print("Enter a short :: ");
  54.        
  55.        s1 = keyboard.nextShort();
  56.        
  57.        System.out.print("Enter a short :: ");
  58.        
  59.        s2 = keyboard.nextShort();
  60.        
  61.        
  62.        
  63.        System.out.println("Double one = " + d1);
  64.        
  65.        System.out.println("integer one = " + intOne);
  66.  
  67.        System.out.println("integer two = " + intTwo);
  68.  
  69.        System.out.println("Double one = " + d1);
  70.        
  71.        System.out.println("Double Two = " + d2);
  72.        
  73.        System.out.println("Float One = " + f1);
  74.        
  75.        System.out.println("Float Two = " + f2);
  76.        
  77.        System.out.println("Short One = " + s1);
  78.        
  79.        System.out.println("Short Two = " + s2);
  80.        }
  81.  
  82.        
  83.    }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement