Assignemnt #11 and Numbers And Math
Code
///Name: Morgan Kaplan
///Period: 5
///Project Name: Numbers And Math
///File Name: NumbersAndMath.java
public class NumbersAndMath
{
public static void main( String[] args )
{
// Prints Out line about person counting chickens
System.out.println( "I will now count my chickens:" );
//prints The amount of hens
System.out.println( "Hens " + ( 25.0 + 30.0 / 6.0 ) );
//prints the amount of roosters
System.out.println( "Roosters " + ( 100.0 - 25.0 * 3.0 % 4.0 ) );
//prints that the person will now count the eggs
System.out.println( "Now I will count the eggs:" );
//Calculates results
System.out.println( 3.0 + 2.0 + 1.0 - 5.0 + 4.0 % 2.0 - 1.0 / 4.0 + 6.0 );
//Asking a true or false question
System.out.println( "Is it true that 3.0 + 2.0 < 5.0 - 7.0?" );
//Calculating results
System.out.println( 3 + 2 < 5 - 7 );
//Asking for a calculation to be simplified
System.out.println( "What is 3.0 + 2.0? " + ( 3.0 + 2.0 ) );
//Asking for a calculation to be simplified
System.out.println( "What is 5.0 - 7.0? " + ( 5.0 - 7.0 ) );
//Stating that the previous question's answer is false
System.out.println( "Oh, that's why it's false." );
//Asking for more
System.out.println( "How about some more." );
// Asking if resultds are larger
System.out.println( "Is it greater? " + ( 5.0 > -2.0 ) );
// Asking If results are equal or greater
System.out.println( "Is it greater or equal?" + ( 5.0 >= -2.0 ) );
//Asking if it's less or equal
System.out.println( "Is it less or equal? " + ( 5.0 <= -2.0 ) );
}
}
Picture of Output