COM 1100 Professor Fell Quiz 7A Solution

```Problem 1
3
25
0
0

Problem 2
Start Flipper x = 5 y = 7 z = 2
End Flipper x = 2 y = 7 z = 5
2 7 2
Start Flipper x = 7 y = 2 z = 2
End Flipper x = 7 y = 2 z = 2
2 7 2
Start Flipper x = 2 y = 2 z = 7
End Flipper x = 2 y = 7 z = 2
7 7 2

Problem 3
Start Flipper x = 10 y = 5 z = 2
End Flipper x = 10 y = 2 z = 5
Start Flipper x = 2 y = 3 z = 2
End Flipper x = 2 y = 3 z = 2
Start Flipper x = 3 y = 1 z = 2
End Flipper x = 3 y = 2 z = 1
Start Flipper x = 2 y = 4 z = 2
End Flipper x = 2 y = 4 z = 2
0 10
1 2
2 3
3 2
4 4

```

Problem 4: Write a C++ function whose arguments are an array of char an an integer N and that returns the number of characters in the first N positions the array that are uppercase letters.

```int UpperCount(char A[ ], int N){
int count = 0;
for (int J = 0; J< N; J++)
if ('A' <= A[J] and A[J] <= 'Z')
count++;
return count;
}
```

Last Updated: October 19, 1997 10:11 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/Q7ASolution.html