{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CS-KEY-PartA-Aug08

# CS-KEY-PartA-Aug08 - Computer Science Foundation Exam...

This preview shows pages 1–4. Sign up to view the full content.

Computer Science Foundation Exam August 8, 2008 Computer Science Section 1A Name: PID: Max Pts Passing Pts Category Score Q1 8 6 KNW, CMP Q2 8 6 ANL Q3 9 6 CMP Q4 8 6 KNW Q5 8 6 DSN Q6 9 6 KNW Total 50 36 You have to do all the 6 problems in this section of the exam. Partial credit cannot be given unless all work is shown and is readable. Be complete, yet concise, and above all be neat .

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Summer 2008 Computer Science Exam, Part A Page 2 of 9 1. [ 8 pts ] Show all your work and indicate your final answer. a) [ 4 pts ] Determine the value of sum in terms of N , when the following code segment is executed: sum = 0; for(i=1; i <= N*N; i++){ for(j=1; j <= N-5; j++) { sum = sum + 3 + 4*j; } }  2 1 5 1 4 3 n i n j j sum  2 1 2 4 5 4 15 3 n i n n n (1 point) (1 point) 2 2 1 2 1 2 25 15 2 40 18 2 15 3 n i n i n n n n n (1 point) 2 3 4 25 15 2 n n n (1 point) There are many equivalent ways to approach this problem. Please be understanding. b) [ 4 pts ] Evaluate the following expression using summation rules and find the closed form in terms of n .   n n i i j 10 2 1 5 n n i n n i i i 10 10 10 10 11 1 1 10 n i n i i i  2 10 11 2 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 9

CS-KEY-PartA-Aug08 - Computer Science Foundation Exam...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online