Advertisement
RazorBlade57

Java

Sep 23rd, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.97 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class InputPresentation {
  3.  
  4.     public static void main(String[] args) {
  5.        
  6. /*----------------------------------------------------*/       
  7.     System.out.println("Enter an integer: ");
  8.     System.out.println("Enter another integer: ");
  9.     Scanner keyboard = new Scanner (System.in);
  10.        
  11.        
  12. /*----------------------------------------------------*/   
  13.         // Variable Declarations
  14.         int first;
  15.         int second;
  16.         double third;
  17.         double fourth;
  18.        
  19. /*----------------------------------------------------*/
  20.         // Variable Values
  21.         first = keyboard.nextInt();
  22.         second = keyboard.nextInt();
  23.         third = first * second;
  24.         fourth = (first + second) * third;
  25.        
  26. /*----------------------------------------------------*/
  27.        
  28.         System.out.println("Variable first = " + first);
  29.         System.out.println("Variable second = " + second);
  30.         System.out.println("Variable third = " + third);
  31.         System.out.println("Variable fourth = " + fourth);
  32.        
  33.        
  34.        
  35.        
  36.        
  37.  
  38.     }
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement