Assignemnt #11 and Numbers And Math
Code
/// Name: Brian Phillips
/// Period: 5
/// Program name: NumbersAndMath
/// File Name: NumbersAndMath.java
/// Date Finished: 9/14/2015
public class NumbersAndMath
{
public static void main( String[] args )
{
System.out.println( "I will now count my chickens:" );
//This will count the hens then the roosters
System.out.println( "Hens " + ( 25 + 30 / 6 ) );
System.out.println( "Roosters " + ( 100 - 25 * 3 % 4 ) );
System.out.println( "Now I will count the eggs:" );
//This will count the eggs
System.out.println( 3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6 );
System.out.println( "Is it true that 3 + 2 < 5 - 7?" );
//This will test if the math problem below is true
System.out.println( 3 + 2 < 5 - 7 );
//Will do the math
System.out.println( "What is 3 + 2? " + ( 3 + 2 ) );
System.out.println( "What is 5 - 7? " + ( 5 - 7 ) );
System.out.println( "Oh, that's why it's false." );
System.out.println( "How about some more." );
//Will test if the following problems are true or false
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