Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Lesson 13 Coding Activity 1
- * Take input of an integer number from the keyboard
- * and print "Positive" if it's positive or zero, and print "Negative" otherwise.
- */
- import java.util.Scanner;
- class Lesson_13_Activity_One {
- public static void main(String[] args)
- {
- Scanner scan = new Scanner(System.in);
- System.out.println("Please enter a interger:");
- int x = scan.nextInt();
- if(x >=0)
- {
- System.out.println("Positive");
- }
- else
- {
- System.out.println("Negative");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment