CS 103 Test 1 Fall 2009
Enter your answers into the Mfiles provided. Each problem has its own Mfile.
Problem 1. (15 points)
A.
Which of the following is not an algorithm.
1.
Start with 11, add each successive prime number until the sum is greater than 1000, stop, and print the sum.
2.
Start your car, put it in reverse, straighten the wheels, drive 15 feet, and stop the car.
3.
Print all integers greater than 100.
4.
All the above are algorithms.
B.
In Matlab, C++, and Java, a named location in memory is called
1.
A variable
2.
A cell
3.
An operator
4.
An index
C.
The transpose of a matrix is obtained by
1.
Reversing the order of the columns
2.
Negating each element
3.
Reversing the order of the rows
4.
Interchanging the row and column indices of each element
D.
Which of the following lists contains only commutative operations?
1.
Addition, subtraction, and array multiplication
2.
Addition, array division, and array multiplication
3.
Addition, array multiplication and matrix multiplication
4.
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '09
 FITZPATRICK
 Addition, 0.05 radian, 0.01 radian, 0.03 radian

Click to edit the document details