Assignment 11
public class NumbersAndMath
{
public static void main( String[] args )
{
//prints
System.out.println( "I will now count my chickens:" );
//calculates expressions and prints results
System.out.println( "Hens " + ( 25. + 30. / 6. ) );
System.out.println( "Roosters " + ( 100. - 25. * 3. % 4. ) );
//prints
System.out.println( "Now I will count the eggs:" );
//calculates expression and prints result
System.out.println( 3. + 2. + 1. - 5. + 4. % 2. - 1. / 4. + 6. );
//prints
System.out.println( "Is it true that 3 + 2 < 5 - 7?" );
//checks truth of inequality and prints result
System.out.println( 3. + 2. < 5. - 7. );
//checks truth of inequalities and prints results
System.out.println( "What is 3 + 2? " + ( 3. + 2. ) );
System.out.println( "What is 5 - 7? " + ( 5. - 7. ) );
//prints
System.out.println( "Oh, that's why it's false." );
//prints
System.out.println( "How about some more." );
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. ) );
}
}