Assignment #11 and Numbers And Math
Code
/// Name: Jack Newsom
/// Period: 5
/// Program Name: NumbersAndMath
/// Filename: NumbersAndMath
/// Date Finished: 9/10/15
public class NumbersAndMath
{
public static void main( String[] args)
{
//prints text
System.out.println("I will now count my chickens:");
//prints text then adds 25 to 30/6
System.out.println("Hens " + (25 + 30 / 6 ) );
//prints text then subtracts the remainder of 25*3/4 from 100
System.out.println("Roosters " + ( 100 - 25 * 3 % 4));
//prints text
System.out.println("Now I will count the eggs:");
//divides adds 3 to 2 to 1 to -5 to 0 to -1 then divides by 10
System.out.println(3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6);
//prints text
System.out.println("Is it true that 3 + 2 < 5 - 7?");
//assesses an inequality
System.out.println(3 + 2 < 5 - 7);
//prints text and adds 3 to 2
System.out.println("What is 3 + 2? " + (3 + 2));
//prints text and adds -7 to 5
System.out.println("What is 5 - 7? " + (5 - 7));
//prints text
System.out.println("Oh, that's why it's false.");
//prints text
System.out.println("How about some more.");
//prints text and assesses inequality
System.out.println("Is it greater? "+(5 > -2 ));
//prints text and assesses inequality
System.out.println("Is it greater or equal? "+(5 >= -2));
//prints text and assesses inequality
System.out.println("Is it less or equal? "+(5 <= -2));
}
}
Picture of the output