Assignment 11
Code
///Name:Nick Quijivix
///Period:7
///Date:9/11/15
public class NumbersAndMath
{
public static void main( String[] args )
{
//It's going to output the line "I will now count my chickens"
System.out.println( "I will now count my chickens:" );
//This will output the number of hens
System.out.println( "Hens " + ( 25 + 30 / 6 ) );
//This will output the number of roosters
System.out.println( "Roosters " + ( 100 - 25 * 3 % 4 ) );
//This will output the line "Now I will count the eggs"
System.out.println( "Now I will count the eggs:" );
//This will output the number of eggs
System.out.println( 3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6 );
//This will output the line "Is it true that 3 + 2 < 5 - 7?"
System.out.println( "Is it true that 3 + 2 < 5 - 7?" );
//This will output if the statement above is true or false
System.out.println( 3 + 2 < 5 - 7 );
//This will output the answer of 3+2
System.out.println( "What is 3 + 2? " + ( 3 + 2 ) );
//This will output the answer of 5-7
System.out.println( "What is 5 - 7? " + ( 5 - 7 ) );
//This will output the line "Oh, that's why it's false"
System.out.println( "Oh, that's why it's false." );
//This will output the line "How about some more"
System.out.println( "How about some more." );
//This will output a true statement
System.out.println( "Is it greater? " + ( 5 > -2 ) );
//This will output a true statement
System.out.println( "Is it greater or equal? " + ( 5 >= -2 ) );
//This will output a false statement
System.out.println( "Is it less or equal? " + ( 5 <= -2 ) );
}
}
Picture of the output