Honors/AP Computer Science Using C++
Name:
Final Exam Review Worksheet #1
Follow the instructions closely for each exercise. Neatly label and organize your answers on lined paper.
Example:
Show the list of values taken by the variable A and circle its last value
as the following segment executes:
int x = 5;
int a = 0;
while (x >= 3)
{
x = x - 1;
if (x % 2 == 0 )
{
a = a +
x;
}
else
{
a = a -
x;
}
}
Answer: a = 0 4 1 3