Assignment #11 and NumbersAndMath
Code
/// Name: Luke Shin
/// Period: 7
/// Program Name: NumbersAndMath
/// File Name: NumbersAndMath.java
/// Date Finished: 9/8/2015
public class NumbersAndMath {
public static void main( String[] args ) {
// announcing what the person will do
System.out.println( "I will now count my chickens:" );
//Number of chickens
System.out.println( "Hens " + ( 25 + 30 / 6 ) );
System.out.println( "Roosters " + ( 100 - 25 * 3 % 4 ) );
// announcing what the person will do
System.out.println( "Now I will count the eggs:" );
// Number of eggs
System.out.println( 3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6 );
// Doing some math
System.out.println( "Is it true that 3 + 2 < 5 - 7?" );
// Doing some math
System.out.println( 3 + 2 < 5 - 7 );
// Doing some math
System.out.println( "What is 3 + 2? " + ( 3 + 2 ) );
System.out.println( "What is 5 - 7? " + ( 5 - 7 ) );
// Explanation
System.out.println( "Oh, that's why it's false." );
// Announcing that the person will do some more math
System.out.println( "How about some more." );
// Doing some math
System.out.println( "Is it greater? " + ( 5 > -2 ) );
System.out.println( "Is it greater or equal? " + ( 5 >= -2 ) );
System.out.println( "Is it less or equal? " + ( 5 <= -2 ) );
}
}
Picture of the output