Assignemnt #11

Code

   /// Name: Daniel Nguyen
   /// Period: 6
   /// Program Name: NumbersAndMath Program
   /// File Name: NumbersAndMath.java
   /// Date Finished: 9/10/2015

public class NumbersAndMath {
    
	public static void main( String[] args ) {
        
		System.out.println( "I will now count my chickens:" );
// Addition and division
		System.out.println( "Hens " + ( 25.0 + 30.0 / 6.0 ) );
// Subtraction Multiplication
		System.out.println( "Roosters " + ( 100.0 - 25.0 * 3.0 % 4.0 ) );

		System.out.println( "Now I will count the eggs:" );

// Addition and Subtraction
		System.out.println( 3.0 + 2.0 + 1.0 - 5.0 + 4.0 % 2.0 - 1.0 / 4.0 + 6.0 );
// Less than Question
		System.out.println( "Is it true that 3 + 2 < 5 - 7?" );
// Less than Question
		System.out.println( 3.0 + 2.0 < 5.0 - 7.0 );
// Addition
		System.out.println( "What is 3 + 2? " + ( 3.0 + 2.0 ) );
// Subtraction
		System.out.println( "What is 5 - 7? " + ( 5.0 - 7.0 ) );

		System.out.println( "Oh, that's why it's false." );

		System.out.println( "How about some more." );
// Greater than question
		System.out.println( "Is it greater? " + ( 5.0 > -2.0 ) );
// Greater than or equal to question
		System.out.println( "Is it greater or equal? " + ( 5.0 >= -2.0 ) );
// Less than or equal to question
		System.out.println( "Is it less or equal? " + ( 5.0 <= -2.0 ) );
	}
}
    

Picture of the output

Assignment 3
BACK HOME NEXT