/* * Strings.java * * This is a simple program that will be used to demonstrate * Strings. * * @author Brad Dennis * Created: 09/11/2016 * Modified: -- */ public class Arithmetic { public static void main(String[] args) { //Part 1. // 1. Answer the first Part 1 question. // 2. Run this program. // 3. Answer the second Part 1 question. System.out.println("************ PART 1 - 5 ************"); int i = 0; i++; System.out.println(i); //Part 2. // 1. DO NOT COMMENT OUT THE PREVIOUS PART! // 2. Uncomment the next block. // 3. Answer the first Part 2 question. // 4. Run this program. // 5. Answer the second Part 2 question. //i++; System.out.println(i); //Part 3. // 1. DO NOT COMMENT OUT THE PREVIOUS PART! // 2. Uncomment the next block. // 3. Answer the first Part 3 question. // 4. Run this program. // 5. Answer the second Part 3 question. //i--; System.out.println(i); //Part 4. // 1. DO NOT COMMENT OUT THE PREVIOUS PART! // 2. Uncomment the next block. // 3. Answer the first Part 4 question. // 4. Run this program. // 5. Answer the second Part 4 question. //i = +i; System.out.println(i); //Part 5. // 1. DO NOT COMMENT OUT THE PREVIOUS PART! // 2. Uncomment the next block. // 3. Answer the first Part 5 question. // 4. Run this program. // 5. Answer the second Part 5 question. //i = -i; System.out.println(i); //Part 6. // 1. Uncomment the next block. // 2. Run this program. // 3. Answer the Part 6 questions. System.out.println("************ PART 6 & 7 ************"); int j = 10; //System.out.println(j++); System.out.println(j); //System.out.println(++j); System.out.println(j); //Part 7. // 1. Uncomment the next block. // 2. Run this program. // 3. Answer the Part 7 questions. //j = 10; //j = ++j + j++; System.out.println(j); //Part 8. // 1. Uncomment the next block. // 2. Answer the first Part 8 question. // 3. Run this program. // 4. Answer the Part 8 questions. System.out.println("************ PART 8 ************"); /* int a = 5; int b = 10; int c = ++a * b--; System.out.println(c); */ //Part 9. // 1. Uncomment the next block. // 2. Answer the first Part 9 question. // 3. Run this program. // 4. Answer the second Part 9 question. System.out.println("************ PART 9 ************"); /* int x = 5; x += 1; x *= 2; System.out.println(x); */ } }