midterm-2-practice-tas

# midterm-2-practice-tas - CSE 114 Practice Midterm Exam 2...

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

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

View Full Document

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.

Unformatted text preview: CSE 114 Practice Midterm Exam 2 Thursday, October 21, 2004 NAME (please print legibly): Your University ID Number: NO BS bonus: If you do not know the answer to a problem and leave it blank you will receive 1 point for each sub-part (e.g., a,b,c, etc.) that you leave blank. If you write anything in the space and it is wrong, you will receive a zero. Thus, the score for a completely blank exam is 12. You will not lose any points for small coding details such as misspelling a method name, leaving out some default method arguments, or getting the order of method arguments wrong. QUESTION VALUE SCORE 1 10 2 25 3 15 4 10 5 20 6 15 TOTAL 95 1 1. (10 points) Write a recursive method sum() that computes the sum of the numbers from 1 to n using the following recursive definition: the sum of 1 to n is equal to the sum of 1 to ( n /2) plus the sum of ( n /2 + 1) to n. public int sum (int a, int n) { } 2 2. (25 points) (a) Define a class GradStudent that represents a student enrolled in a graduate program. In(a) Define a class GradStudent that represents a student enrolled in a graduate program....
View Full Document

{[ snackBarMessage ]}

### Page1 / 7

midterm-2-practice-tas - CSE 114 Practice Midterm Exam 2...

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

View Full Document
Ask a homework question - tutors are online