- Complete the following review handwritten on paper and make sure to
**put your name on your paper**. - Your work will be reviewed and graded, so make it presentable.
- The following problems are
**due before the test starts**. - Review of your work by another student is required for full credit. Add the following at the
**top of the first page**of your paper:Reviewed by:

Discuss the issues and correct any problems found during the review.*reviewing student's name*

- A. Data Types
- B. Variables and Assignment
- C. Counting and Arithmetic
- D. Characters and ASCII
- E. Strings and Substrings
- F. Test Conditions
- G. Tracing
`if`

-statements - H. Tracing
`while`

Loops

- Write the letter and heading for this problem on your paper.
- Review data types in lesson 3.1.3.
- On your paper, create three columns with these headings:
Number Type/error Description of type/error - For each of the following number examples in C++ code, write the information about the number under the above column headings. If there is an error, write "error" and explain why in the description. For example: (4m)
3 int A positive integer `3`

`-3`

`3.0`

`3.14`

`3 14/100`

`300,000`

`3e5`

- Review your work with another student in the class and correct any problems.

- The problem with the following code snippet is ________.
int value; value = 1.23;

- The "value" variable is never initialized.
- The data type for the "value" variable is not specified.
- The "value" variable is never assigned a value.
- The "value" variable is assigned a decimal value, but it can store only a whole number value.

- In an airline reservation system, the cost of an airline ticket is required. The data type that should be used to store this value is a single ________.
- int
- long
- double
- short

- Write the letter and heading for this problem on your paper.
- Review lesson 3.1.5: (Variable) Summary.
- On your paper, write the problem number (1a, 1b, ..., 2) and a solution to the following problems: (8m)
- Declare a single variable and assign the variable a value for storing each of the following types of data:
- Dollars and cents
- The count of the number of people in a room
- A single letter
- Whether or not a door is open or closed.
- A sequence of characters making up a person's name.

- Write the value of a and b on your paper after the following code snippet executes
int a = 10; int b = 20; a = b;

a is ________ b is ________ - Write the value of a and b on your paper after the following code snippet executes
int a = 7; int b = 5; a = b; b = 3;

a is ________ b is ________

- Declare a single variable and assign the variable a value for storing each of the following types of data:
- Review your work with another student in the class and correct any problems.

- The problem with the following code snippet is ________.
int value; value = 1.23;

- The "value" variable is never initialized.
- The data type for the "value" variable is not specified.
- The "value" variable is never assigned a value.
- The "value" variable is assigned a decimal value, but it can store only a whole number value.

- Write the letter and heading for this problem on your paper.
- Review lesson 2.3.6: (Arithmetic) Summary.
- On your paper, write the problem number and a solution for the following problems:
- First operation performed in
`1 + 2 * 3 / 4 % 5`

is ________. - The value of x after the following code executes is ________.
double x = 9 / 4;

- The value of x after the following arithmetic expression and assignment is ________.
double x = 1 + 2 * 3 / 4 % 5;

- Write the following math expression as C++ code:

- First operation performed in
- Review your work with another student in the class and correct any problems.
*Hint*: Verify your computations by trying them in C++.

- Of the following, the one that is NOT a complete statement for adding 1 to
`numAnts`

is ________.`numAnts + 1;`

`numAnts = numAnts + 1;`

`numAnts = 1 + numAnts;`

`numAnts = numAnts + 1 / 1;`

- Write the letter and heading for this problem on your paper.
- Review lesson 3.2.1: Type
`char`

. - On paper, write the question numbers and the value of
`ch`

after executing each of the following statements. (3m)`char ch = '0' + 3;`

;`char ch = 'A' + 3;`

;`char ch = 'd' - 'a' + 'A';`

;`char ch = 'D' - 'A' + 'a';`

;

- Review your work with another student in the class and correct any problems.
*Hint*: Verify your computations by displaying`ch`

in C++.

- Write the letter and heading for this problem on your paper.
- Review lesson 3.3.2: String Functions.
- On paper, write the question numbers and the code to extract the last word from each of the following strings. (3m)
`string str = "Do. Or do not. There is no try."; // George Lucas (Yoda)`

;`string str = "Whether You Believe You Can Do a Thing or Not, You Are Right."; // Henry Ford`

;`string str = "It always seems impossible until it's done."; // Nelson Mandela`

;`string str = "If you're going through hell, keep going."; // Winston Churchill`

;`string str = "No one can make you feel inferior without your consent."; // Eleanor Roosevelt`

;

- Review your work with another student in the class and correct any problems.
*Hint*: Verify your substring by displaying your code in C++.

- Write the letter and heading for this problem on your paper.
- Review lesson 3.3.2: Relational Operators.
- On paper, write the question numbers and the value (
`true`

or`false`

) of the following test conditions, given`x = 3`

,`y = 7`

. (3m)`(x != y)`

`(x == y)`

`(x < y)`

`(x >= y)`

`(x <= 42`

)

- Review your work with another student in the class and correct any problems.

`if`

-statements - Write the letter and heading for this problem on your paper.
- Review the first half of section 3.3.6: (Conditional) Summary.
- On your paper, write the problem numbers and a solution to the following problems: (4m)
- The value of x after the following code executes is ________.
int x = 7; if (x == 3) { x = 1; }

- The value of x after the following code executes is ________.
int x = 3; int y = 4; if (x < y) { x = y; }

- The value of x after the following code executes is ________.
int x = 5; if (x > 3) { x = x - 2; } else { x = x + 2; }

- The value of x after the following code executes is ________.
int x = 1; if (x > 0) { x = x + 5; } else if (x > 1) { x = x + 2; } else { x = x + 7; }

- The value of x after the following code executes is ________.
- Review your work with another student in the class and correct any problems.

`while`

Loops- Write the letter and heading for this problem on your paper.
- Review the while loop in lesson lesson 4.3.3.
- For the following code, on your paper trace the value of variable
`repeat`

, including the initial value, and what is printed to the console if the user enters:`y, y, n, y`

char repeat = 'y'; while ('y' == repeat) { cout << "\nPlaying an exciting game!\n"; cout << "Do you want to play again? (y/n) "; cin >> repeat; }

repeat output - After tracing, write the final number of repeats on your paper and circle the answer.
- Review your work with another student in the class and correct any problems.

- The first (initial) value of
`repeat`

is ___. - The last value of
`repeat`

is ___. - The message, "Playing an exciting game!", is displayed this many times: ___.