-> Circle the letter corresponding to EVERY item below which is considered to be computer HARDWARE. a) mouse b) spreadsheet c) compiler d) floppy disk drive -> Circle the letters corresponding to each TRUE statement below. a) A valid identifier is 'ima_10'. b) A valid identifier is '4yonly'. c) Result gets the value 3 in the statement: Result = 14 / 4; d) Assignment operators have the highest order of precedence. e) Right to left is the default order of statement execution. f) The unary operators have a higher order of precedence than all the binary arithmetic operators. g) A variable can never be initialized when it is declared. h) Microsoft Word is computer software. i) The Unix operating system is computer hardware. j) A CD drive is computer software. k) C++ programs must be executed before they are compiled. l) Programs are moved into main memory when being run. m) Object oriented programming focusses on how to do things in a procedural action-oriented way. n) FORTRAN is an object oriented programming language. o) The statement { cin << myvar; } correctly reads a value into the integer variable myvar. p) Syntax errors are mistakes in a program based on pseudocode errors that are not caught until a program is run. q) A valid C++ identifier is "300ZX". r) A valid C++ identifier is "mazda626". s) Dividing by zero is a common run-time error. t) Missing a semi-colon is a common compile-time error. u) Assigning an integer value to a double variable causes a syntax error. -> Write an algorithm expressed in pseudocode for averaging 3 numerical grades that are input by the user. -> What is the value assigned to float variable x in each statement below? x = 2 + 5 - 8 / 3 * -1; ______________ x = (10 + 4) % 4 - 1; ______________ Multiple choice: for each problem circle EVERY correct possible answer in C++. -> Statement to output the instructor's name and go to the next line: a) cout << "Houlahan" << endl; b) outputline(Houlahan); c) cout << "Houlahan\n"; d) println("Houlahan"); -> Statement to declare and initialize an integer to 12: a) int 12; b) int myint 12; c) int myint=12; d) integer myint=12; -> Statement to square the variable mynum: a) mynum^2; b) mynum *= mynum; c) mynum *= 2; d) mynum = mynum * mynum; -> Statement to read input into the float variable fnum: a) floatin >> fnum; b) read(float, fnum); c) cin >> fnum; d) cout << fnum; For the next questions, write the EXACT output of each code segment. BE VERY CAFEFUL and trace through the code thoroughly. Feel free to mark up the code (boxes, etc.) because the indentation can be misleading. Assume the following declarations: int n1, n2; float r1; -> n1 = 3; n2 = 4; if (2*n1 < n2 % 2) cout << "yes\n"; if (n2 != 0) cout << "n2"; else cout << "no"; -> n1 = 1234; r1 = 100.0; n2 = n1 / 10; cout << n1 << " " << n2; cout << " " << n1 / r1; -> n1 = 10; r1 = 15.3; r1 = (r1 - n1) / 10; n1 = (int) ((r1 + 7) * 2); cout << "num is " << n1 << endl; -> int a = 16, b; double x, y = 36.0; b = 12.3 + a / 5 - 12 % 5; x = 12.3 + a / 5 - 12 % 5; cout << "b = " << b << " x = " << x << endl; cout << "square root of y is " << sqrt(y) << endl; cout << pow(2,3) << " " << ceil(8.3) << endl; if (pow(2,3) > ceil(8.3)) cout << "pow is greater\n"; y += a; cout << y << " " << y / 5 << endl; cout << "end part A" << endl; -> char c1 = 'g', c2 = 'R'; if (c1 < 'y' && c2 < 'Y') if (c2 < 'f') cout << 20; else cout << 30; -> What are the three main types of program execution control? -> What is the output of the following program? /************************ ACTUAL PROGRAM *********************/ #include #include void funk0 (); int funk2 (char); void funk5 (int &, int); int funk6 (float &, float &); int main() { const int m = 15; int i, j, k; float x, y, z; char c = 'C'; funk0(); cout << funk2(c) << endl; j = funk2('e'); cout << j << endl; i = 4; j = 3; funk5(i, j); cout << i << ' ' << j << endl; i = 4; j = 3; funk5(j, i); cout << i << ' ' << j << endl; x = 1.2; y = 2.3; z = 3.4; i = funk6(x, y); cout << i << endl; cout << x << ' ' << y << ' ' << z << endl; return 0; } // end of main void funk0 () { cout << "got to be funky" << endl; return; } int funk2 (char c) { if ('A' <= c && 'Z' >= c) return c - 'A' + 1; return c - 'a' + 1; } void funk5 (int & ir, int j) { cout << ir << ' ' << j << endl; cout << "funk5" << endl; ir = j; j = ir * 2; cout << ir << ' ' << j << endl; } int funk6 (float & x, float & y) { float z = x; x = y; y = z; return (int) floor(x + y); } -> Write a complete C++ program to output a random value between 5 and 35.