COM 1100 Professor Fell Quiz 2A October 2, 1997

1. Use the windows below to show the output of the following code:
(The grid boxes are 20 pixels apart.)

// function prototypes
void NumberTask();
void DrawingTask();
void spacer();

// definitions void main(){ // open text and drawing windows TinySquarePair(); // do the work here spacer(); DrawingTask(); spacer(); NumberTask(); spacer(); PressReturn(); } void spacer() {
cout << "<><><><><><><><>" << endl; } void NumberTask(){ for (int N = 1; N <= 5; N++) cout << N <<" "<< N / 2 << endl; } void DrawingTask(){ cout << "Drawing Circles" << endl; for (int M = 20; M < 150; M += 30) PaintCircle(100, M, 10); }

2. Write for loop that has the following output:

1. I will do my work on time.
2. I will do my work on time.
3. I will do my work on time.
4. I will do my work on time.
5. I will do my work on time.
6. I will do my work on time.
7. I will do my work on time.
8. I will do my work on time.


Last Updated: October 5, 1997 5:34 pm by
Harriet Fell
College of Computer Science, Northeastern University
360 Huntington Avenue #161CN,
Boston, MA 02115
Internet: fell@ccs.neu.edu
Phone: (617) 373-2198 / Fax: (617) 373-5121
The URL for this document is: http://www.ccs.neu.edu/home/fell/COM1100/QUIZ/QUIZ2A.html