Public feed #888241

Anonymous

public text v1 · immutable
Raw Edit
·published 2008-02-01 23:33 UTC
rendered paste body
import java.util.Scanner;

public class Assignment3 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		//Determine:
		//whether the integer is positive, negative, or zero.
		//whether the integer is odd or even.
		//whether the integer is divisible by 3, 5, or 7.
		//whether the integer is divisible by 3, 5, and 7.
		
		Scanner keybd = new Scanner(System.in);
		System.out.print("Enter an integer: ");
		int num = keybd.nextInt();
		
		//Determine if num is positive or negative
		if (num > 0) {
			System.out.println(num + " is positive.");
		} else if (num < 0) {
			System.out.println(num + " is negative.");
		} else System.out.println(num + " is just zero!");
		
		//Determine if num is even or odd
		if (num % 2 == 0 ) {
			System.out.println(num + " is even.");
		}  else if (num % 2 != 0 ) {
			System.out.println(num + " is odd.");
		}
		
		//Determine if int is divisible by 3, 5, or 7
		if (num % 3 == 0) {
			
		}
		
		
		
			
	}

}