Assignemnt #28
Code
/// Name: Ryan Volko
/// Period: 7
/// Program Name: Modification Program
/// File Name: Modification.java
/// Date Finished: 10/5/2015
public class Modification
{
public static void main( String[] args )
{
int x, y, z;
x = 2;
y = 2;
z = 2;
System.out.println( "x: " + x + "\ty: " + y + "\tz: " + z );
x = x + 5;
y = y - 5;
z = z * 5;
System.out.println( "x: " + x + "\ty: " + y + "\tz: " + z );
x = 6;
y = 6;
z = 6;
System.out.println( "\nx: " + x + "\ty: " + y + "\tz: " + z );
x += 2;
y -= 2;
z *= 2;
System.out.println( "x: " + x + "\ty: " + y + "\tz: " + z );
x = y = z = 7;
System.out.println( "\nx: " + x + "\ty: " + y + "\tz: " + z );
x += 9;
y -= 5;
z *= 3;
System.out.println( "x: " + x + "\ty: " + y + "\tz: " + z );
x = y = z = 5;
System.out.println( "\nx: " + x + "\ty: " + y + "\tz: " + z );
x =+ 1;
y =- 2;
System.out.println( "x: " + x + "\ty: " + y + "\tz: " + z );
x = y = z = 1;
System.out.println( "\nx: " + x + "\ty: " + y + "\tz: " + z );
x++;
y--;
System.out.println( "x: " + x + "\ty: " + y + "\tz : " + z );
}
}
Picture of the output