Assignemnt #11
Code
/// Name: Holden Ganch
/// Period: 7
/// Program Name: eleventh Program
/// File Name: NumbersAndMath.java
/// Date Finished: 9/9/2015
public class NumbersAndMath
{
public static void main( String[] args )
{
System.out.println( "I will now count my chickens:" );
// line of type
System.out.println( "Hens " + ( 25 + 30 / 6 ) );
// divides 30 by 6 beofer adding 25 order of operations
System.out.println( "Roosters " + ( 100 - 25 * 3 % 4 ) );
// it does the math for you
System.out.println( 3.0 + 2.0 + 1.0 - 5.0 + 4.0 % 2.0 - 1.0 / 4.0 + 6.0 );
// adding the .0 allows the computer to make the number into a fraction becoming more exact
}
}
Picture of the output