Assignemnt #11 and NumbersAndMath
Code
/// name: Leila Ordukhani
/// period: 6
/// program name: Eighth Program
/// file name: NumbersAndMath.java
/// date finished: 9/15/15
public class NumbersAndMath
{
public static void main( String[] args )
{
// about to count chickens
System.out.println( "I will now count my chickens:" );
//total of hens
System.out.println( "Hens " + ( 25.0 + 30.0 / 6.0 ) );
//counting total of roosters
System.out.println( "Roosters " + ( 100.0 - 25.0 * 3.0 % 4.0 ) );
//about to count eggs
System.out.println( "Now I will count the eggs:" );
//adding and subtracting
System.out.println( 3.0 + 2.0 + 1.0 - 5.0 + 4.0 % 2.0 - 1.0 / 4.0 + 6.0 );
//asking a word problem about inequalities
System.out.println( "Is it true that 3.0 + 2.0 < 5.0 - 7.0?" );
//solving the inequality
System.out.println( 3.0 + 2.0 < 5.0 - 7.0 );
//asking an addition problem
System.out.println( "What is 3.0 + 2.0? " + ( 3.0 + 2.0 ) );
//asking a subtraction problem
System.out.println( "What is 5.0 - 7.0? " + ( 5.0 - 7.0 ) );
//stating why it's incorrect
System.out.println( "Oh, that's why it's false." );
//introduction to more word problems
System.out.println( "How about some more." );
//asking aother inequality number with a negative number
System.out.println( "Is it greater? " + ( 5.0 > -2.0 ) );
//asking whay type of inequality
System.out.println( "Is it greater or equal? " + ( 5.0 >= -2.0 ) );
//asking what kind of inequality again
System.out.println( "Is it less or equal? " + ( 5.0 <= -2.0 ) );
}
}
Picture of the output