StefanTobler

Lesson 11 Activity 1

Sep 25th, 2016
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. /*
  2.  * Lesson 11 Coding Activity 1
  3.  * Test if an integer input from the keyboard is equal to the integer 176.
  4.  * If it is, print "YES" (without the quotes).
  5. */
  6.  
  7. import java.util.Scanner;
  8. import java.lang.Math;
  9.  
  10.  
  11. class Lesson_11_Activity_One {
  12.    
  13.      
  14.      
  15. public static void main(String[] args)
  16.    {
  17.        Scanner scan = new Scanner(System.in);
  18.        
  19.        System.out.println("Enter a whole number.");
  20.        
  21.        int x = scan.nextInt();
  22.        
  23.        if(x == 176){
  24.          System.out.println("YES");
  25.          
  26.          scan.close();
  27.        }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment