Assignment # 11 and Numbers And Math
Code
/// Name: Tommy Oyuntseren
/// Period: 7
/// Program Name: NumbersAndMath
/// File Name: NumbersAndMath.java
/// Date Finished: 9/22/15
public class NumbersAndMath {
public static void main( String[] args ) {
// He's announcing what he's gonna do
System.out.println( "I will now count my chickens:" );
// Doing Some Math
System.out.println( "Hens " + ( 25 + 30 / 6 ) );
System.out.println( "Roosters " + ( 100 - 25 * 3 % 4 ) );
// Annoucning that he's going to count the eggs
System.out.println( "Now I will count the eggs:" );
// Showing the # of Eggs
System.out.println( 3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6 );
// Doing Some Math and Asking a Question
System.out.println( "Is it true that 3 + 2 < 5 - 7?" );
// Doing Some Math
System.out.println( 3 + 2 < 5 - 7 );
// Doing Some Math and Asking Questions
System.out.println( "What is 3 + 2? " + ( 3 + 2 ) );
System.out.println( "What is 5 - 7? " + ( 5 - 7 ) );
// Answering the question
System.out.println( "Oh, that's why it's false." );
// Announcing that the person will do some more math
System.out.println( "How about some more." );
// Asking Questions and Solving the Problems
System.out.println( "Is it greater? " + ( 5 > -2 ) );
System.out.println( "Is it greater or equal? " + ( 5 >= -2 ) );
System.out.println( "Is it less or equal? " + ( 5 <= -2 ) );
}
}
Picture of the output