Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

O; i < 10; i++);

for (int i =
/ * Intended body goes here */ and the intended body that follows is not the
The semicolon terminates the for statement,
indented.
body, even though it may be properly
Clcon

answer key) (18 mins + 2 mins checking)


2) Activity 3: Skill-building Activities (with
1. What is printed by the following code fragment? Yabe
int x = O; COO
do {
cout << x <<

} while (x < 10);


cout << '\n l •,
2. What is printed by the following code fragment?
int x = 20;
do {
cout << x <<

} while (x < 10);


i
cout << \n l •,
the for statement.
3. Rewrite the following code fragment so a while loop is used instead of
for (int i = 100; i > 0; i--)
l\n l;
cout << i 77
70)
4. What is printed by the following code fragment?
for (int x = O; x < 10; x++) u
11*11.
cout <<
cout << An t;
5. What is printed by the following code fragment?
for (int x = 1; x 5; x++);
cout <<
cout << '\n l ;

3) Activity 4: What I Know Chart, part 2 (2 mins)


Chis serves as the student's review and summary of what was leamed from the session.}
Monitorhow your knowledgehas changed by reviewingthe questions in the What I Know Chart from
Activity 1 and write your answers to the questions based on what you now know in the third column of
the chart.

4) Activity 5: Check for Understanding (5 mins)


Trace the output for the following:
#include <iostream.h>
ITE 295: ComputerProgramming
PHINMA EDUCATION
LEV'S
Student Activity Sheet #10

Class number .
s

Name• Date:
Section. Schedule:
S RyneS
#include <iomanip.h>
void main () {
char charots =
for (int first = 1; first <= 5; first ++) {
for (int second = 1; second <= 5; second++){
000
cout << setw(4) << charots;
charots++;

C. LESSON WRAP-UP
1) Activity 6: Thinking about Learning (9 mins)
ackerwhich is simply a visual to help you track how much work you have

You might also like