Assignemnt #11 Numbers and Math
Code
/// Name: Drew Boxold
/// Period: 5
/// Program Name: 11
/// File Name: NumbersAndMath
/// Date Finished: 9/10/2015
public class NumbersAndMath
{
public static void main( String[] args )
{
//regular print line
System.out.println( "I will now count my chickens:" );
//diving 30 by 6 and then adding 25 equaling 30
System.out.println( "Hens " + ( 25 + 30 / 6 ) );
//multiplying 25 by 3 then diving by 4 and then subtracting that from 100
System.out.println( "Roosters " + ( 100 - 25 * 3 % 4 ) );
//regular print line
System.out.println( "Now I will count the eggs:" );
//adding 3 + 2 + 1 subreatcing 5 and adding 4%2-1/4+6
System.out.println( 3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6 );
//print line saying that is 3+2<5-7 which is false
System.out.println( "Is it true that 3 + 2 < 5 - 7?" );
//Print line equation that is false
System.out.println( 3 + 2 < 5 - 7 );
//addition lines
System.out.println( "What is 3 + 2? " + ( 3 + 2 ) );
System.out.println( "What is 5 - 7? " + ( 5 - 7 ) );
//regular print line
System.out.println( "Oh, that's why it's false." );
//regular print line
System.out.println( "How about some more." );
//regular print line with true statement
System.out.println( "Is it greater? " + ( 6 > -3 ) );
//regular print line with true statement
System.out.println( "Is it greater or equal? " + ( 5 >= -2 ) );
//regular print line with false statement
System.out.println( "Is it less or equal? " + ( 5 <= -2 ) );
}
}
Picture of the output