Assignment #11 and Eight Program
Code
/// Name: Georgi Atanasov
/// Period: 5
/// Program Name: NumbersAndMath
/// File Name: NumbersAndMath.java
/// Date Finished: 9/14/2015
public class NumbersAndMath
{
public static void main( String[] args )
{
// First line
System.out.println( "I will now count my chickens:" );
// Hens and math
System.out.println( "Hens " + ( 25.0 + 30.0 / 6.0 ) );
System.out.println( "Roosters " + ( 100.0 - 25.0 * 3.0 % 4.0 ) );
// Eggs counting
System.out.println( "Now I will count the eggs:" );
// Numbers being added up
System.out.println( 3.0 + 2.0 + 1.0 - 5.0 + 4.0 % 2.0 - 1.0 / 4.0 + 6.0 );
// Question
System.out.println( "Is it true that 3.0 + 2.0 < 5.0 - 7.0?" );
// Less than sign
System.out.println( 3.0 + 2.0 < 5.0 - 7.0 );
// More addition
System.out.println( "What is 3.0 + 2.0? " + ( 3.0 + 2.0 ) );
System.out.println( "What is 5.0 - 7.0? " + ( 5.0 - 7.0 ) );
// Oh moment
System.out.println( "Oh, that's why it's false." );
// Another question
System.out.println( "How about some more." );
// More questions
System.out.println( "Is it greater? " + ( 5.0 > -2.0 ) );
System.out.println( "Is it greater or equal? " + ( 5.0 >= -2.0 ) );
System.out.println( "Is it less or equal? " + ( 5.0 <= -2.0 ) );
}
}
Picture of the output