Assignemnt #17
Code
/// Name: Ryan Volko
/// Period: 7
/// Program Name: MathOperations Program
/// File Name: MathOperations.java
/// Date Finished: 9/21/2015
public class MathOperations
{
public static void main( String[] args )
{
int x, y, z, r, q, p;
double a, b, c, d;
String one, two, both;
x = 2;
y = 4;
z = 8;
System.out.println( "x is " + x + " y is " + y + " and z is " + z );
r = x + y;
System.out.println( "x+y is " + r );
q = z - x;
System.out.println( "z-x is " + q );
p = z / y;
System.out.println( "z/y is " + p );
a = 3;
System.out.println( "a is " + a );
b = a*a;
System.out.println( "a*a is " + b );
c = b/2;
System.out.println( "b/2 is " + c );
d = c+.6;
System.out.println( "c+.6 is " + d );
one = "spider";
two = "man";
both = one + two;
System.out.println( both );
}
}
Picture of the output