final_00_ans

final_00_ans - Solution and Marking Scheme for Final...

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

1 Solution and Marking Scheme for Final Exam (Fall 2000) 1. (4 pts total) a) 25 (1 pt) b) 0 (1 pt) c) 24 (1 pt) d) A[2] = 3; (1 pt) 2. (4 pts total) a) True (1 pt) b) False (1 pt) c) True (1 pt) d) False (1 pt) 3. (5 pts total) 103 (1 pt) 104 (1 pt) 104 (1 pt) 105 (1 pt) 104 (1 pt) 4. (6 pts total) a) a de h (1 pt) b) 1234567891 1 (1 pt) 5. (15 pts total) a) int table[3][5] (1 pt) row < 3; row++ (2 pts) col < 5; col++ (2 pts) row * 10 + col (3 pts) b) const int data[][5], int row, int size (2 pts; ok to have no const ) double sum = 0.0; (1 pt) for (int col = 0; col < size; col++) (3 pts) sum += data[row][col]; return (sum / size); (1 pt)

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

View Full Document
2 6. (4 pts total) #include <iostream.h> #include <fstream.h> int main() { ifstream ins; ofstream outs; // new (1 pt) int number; ins.open("input.dat"); outs.open("output.dat"); // new (1 pt) for (int i = 0; i < 10; i++) { ins >> number; cout << number << " "; outs << number << " "; // new (1 pt) } ins.close(); outs.close(); // new (1 pt)
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 4

final_00_ans - Solution and Marking Scheme for Final...

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

View Full Document
Ask a homework question - tutors are online