COM 1100 Professor Fell Quiz 7B Solution


Problem 1
15
25
10
0

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

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


Press Return To Continue 

Problem 4: Write a C++ function whose arguments are an array of char and an integer N and that returns true if the first N char of the array are ALL uppercase letters and false otherwise.

bool AllUpper(char A[ ], int N){
	for (int J = 0; J< N; J++)
		if  (not ('A' <= A[J] and A[J] <= 'Z'))
			return false;
	return true;
}


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/Q7BSolution.html