---------------------------------------- ** On paper portion. Points: 20 points total, 10 points for #1, 10 points for #2 Last Name: First Name: Section (start time of your class): 1) Do the conversion. Show your work. No credit if you don't show some work. 1a) Convert 118 decimal to binary. 1b) Convert 118 decimal to hex. 1c) Convert 1110110 binary to hex. 1d) Convert 1110110 binary to decimal. 2) Be the computer. For each, keep track of the values of all the variables as the code runs - as we did in class. 2a) basic arithmetic. // code int x = 100, y = 5; float z = x / y; x = x - y * 2; y = y + y * 2; y = (x + y) % 10; z = z / 5.0; // variable values. // // x: // // y: // // z: // 2b) Boolean logic, conditionals. // code float f = 2.7; int x = 30; if (f < 0.0 && f > 10.0) { if (x <= 30.0) x = x / 2; else x = x - 2; f = f - 1.0; } else { if (x > 3.0) x = x * x; else x = x + x; f = f + f; } x = (f <= 2.7 && x < 100) || (f >= 0 && x >= 10); // variable values. // // x: // // f: // 2c) Loops. // code int i; int total=0; for(i=0; i < 10; i += 3) { total = total + i; } // variable values. // // i: // // total: //