Assignment # 11

code


///Name: Mutsu Osoegawa
///Period: 7
///Project Name: Numbers and Math
///File Name: NumbersAndMath
///Date: 9/11/2015

public class NumbersAndMath {
public static void main(String[] args){
    System.out.println( "I will now count my chikens:" );
    // Adds 25 to 30 over 6, + is addition, / is division or fraction
    System.out.println("Hens " + ( 25.0+ 30.0/6.0 ) );
    // * is multiplication, % displays the remainder of a number divided by another. 
    // 25 times 3 is 75 divided by 4 is 18 remainder 3, 100-3 is 97
    System.out.println( "Roosters " + ( 100.0 - 25.0 * 3.0 % 4.0 ) );
    System.out.println( "Now I will count the eggs:" );
    
    System.out.println(3.00 + 2.00 + 1.00 - 5.00 + 4.00 % 2.00 -1.00 / 4.00 + 6.00 );
    
    System.out.println( "Is it true that 3 + 2 < 5 - 7?" );
    // < displays whether the system of equasion is true or false
    System.out.println( 3 + 2 < 5 - 7);
    //adds 3+2
    System.out.println( "What is 3 + 2? " + (3.0 + 2.0) );
    //subtracts 5-7
    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." );
    //displays if inequality is true, 5 greater than negative 2
    System.out.println( "Is it greater?" + ( 5.0 > -2.0 ) );
    //displays if inequality is true, for 5 greater than or equal to negative 2
    System.out.println( "Is it greater or equal?" + (5.0 >= -2.0 ) );
    //displays if inequality is true for 5 equal or less than negative 2
    System.out.println( "Is it less or equal?" + ( 5.0 <= -2.0 ) );
    }
    }