/home/caleb/ASDV-Java/lab6_CalebFontenot/src/main/java/com/calebfontenot/lab6_calebfontenot/If3.java |
nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt
nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java
package com.calebfontenot.lab6_calebfontenot;
import java.util.Scanner;
public class If3 {
public static void main(String[] args) {
int number;
System.out.println("Please type a positive number: ");
if ( (number = new Scanner(System.in).nextInt() ) >= 0 )
System.out.println("Tou typed a positive number. It was number " + number + "!");
else
System.out.println("You typed a negative number. It was number " + number + "!");
}
}