Assignemnt #11 and Numbers and Math
Code
/// Name: Nick Cerdan
/// Period: 6
/// Program Name: NumbersAndMath
/// File name: NumbersAndMath.java
/// Date Finished: 9/10/15
public class NumbersAndMath
{
public static void main( String[] args )
{
System.out.println( "I will now count my chickens:" );
// Counts and labels how many hens and roosters there are
System.out.println( "Hens " + ( 25.0 + 30.0 / 6.0 ) );
System.out.println( "Roosters " + ( 100.0 - 25.0 * 3.0 % 4.0 ) );
// New title
System.out.println( "Now I will count the eggs:" );
// displays 7
System.out.println( 3.0 + 2.0 + 1.0 - 5.0 + 4.0 % 2.0 - 1.0 / 4.0 + 6.0 );
// askes if the equation is true
System.out.println( "Is it true that 3 + 2 < 5 - 7?" );
// false statement to display 'false'
System.out.println( 3.0 + 2.0 < 5.0 - 7.0 );
// asks a math question then does calculation
System.out.println( "What is 3 + 2? " + ( 3.0 + 2.0 ) );
System.out.println( "What is 5 - 7? " + ( 5.0 - 7.0 ) );
// says that its false
System.out.println( "Oh, that's why it's false." );
// another line of question
System.out.println( "How about some more." );
// asks the condition and calculates it to see if theyre true or false
System.out.println( "Is it greater? " + ( 5.0 > -.02 ) );
System.out.println( "Is it greater or equal? " + ( 5.0 >= -2.0 ) );
System.out.println( "Is it less or equal? " + ( 5.0 <= -2.0 ) );
}
}