Assignemnt #28
Code
/// Name: Holden Ganch
/// Period: 7
/// Program Name: twenty eighth Program
/// File Name: VariableChangeShortcuts.java
/// Date Finished: 10/5/2015
public class VariableChangeShortcuts
{
public static void main( String[] args )
{
int i, j, k;
i = 8;
j = 8;
k = 8;
System.out.println( "i: " + i + "\tj: " + j + "\tk: " + k );
i = i + 3;
j = j - 3;
k = k * 3;
System.out.println( "i: " + i + "\tj: " + j + "\tk: " + k );
i = 4;
j = 4;
k = 4;
System.out.println( "\ni: " + i + "\tj: " + j + "\tk: " + k );
i += 2;
j -= 2;
k *= 2;
System.out.println( "i: " + i + "\tj: " + j + "\tk: " + k );
i = j = k = 5;
System.out.println( "\ni: " + i + "\tj: " + j + "\tk: " + k );
i += 1;
j -= 2;
k *= 3;
System.out.println( "i: " + i + "\tj: " + j + "\tk: " + k );
i = j = k = 8;
System.out.println( "\ni: " + i + "\tj: " + j + "\tk: " + k );
i =+ 1;
j =- 2;
System.out.println( "i: " + i + "\tj: " + j + "\tk: " + k );
i = j = k = 8;
System.out.println( "\ni: " + i + "\tj: " + j + "\tk: " + k );
i++;
j--;
System.out.println( "i: " + i + "\tj: " + j + "\tk: " + k );
}
}
Picture of the output