if (rain==y) |
|
if (rain ==y)
System.out.println("Bring umbella");
else
System.out.println("Bring sunglasses"); |
|
if (grade > 90)
System.out.prinln("A+");
else if (grade > 80)
System.out.prinln("A");
|
| --N U M B E R A N A L Y S I S--
Please enter an integer: -4 The number is even |
public class choice
{
public static void main (String args [])
{
new choice ();
}
public choice ()
{
System.out.println ("--N U M B E R A N A L Y S I S--\n");
int num = IBIO.inputInt ("Please enter an integer: ");
System.out.println("");
//Calculate if even or odd
if (num % 2 == 0)
System.out.println ("The number is even");
else
System.out.println ("The number is odd");
//Calculate if negative, zero or positive
if (num < 0)
System.out.println ("The number is negative");
else if (num == 0)
System.out.println ("The number is neither positive nor negative");
else
System.out.println ("The number is positive");
} }