Docsity

Practice Quiz 1 - Computing for Engineers | CS 1371, Quizzes of Computer Science

Toggle sidebar
bg1
CS1371 Practice Quiz 1 12 September 2003
NOTE: You could lose five points if this page is not completed
correctly!
Academic misconduct (including, but not limited to, the list below) could result in a zero on
this exam, an F grade in the course, and/or other disciplinary action:
Communication with anyone other than a proctor for ANY reason in ANY language in ANY
manner.
Sharing of ANYTHING (e.g. pencils, paper, erasers).
Writing on paper that is not given to you by a proctor.
Cell phones, beepers, hand-held computers, calculators, etc. in your possession during the
exam.
Failure to follow directions given by the proctor.
Failure to stop writing when the allowed time is up (as reported by the proctor).
Using books or other reference material.
Disruption of the exam setting.
Print your GT number in the spaces
provided, and shade the boxes of the
corresponding numbers and letters.
By taking this exam, you signify that it is
your work and that you have neither given
nor received inappropriate help during the
taking of this exam in compliance with the
Academic Honor Code of Georgia Tech.
Name (Print):
Signature:
TA’s Name:
Proble
m
Possibl
e
Points
Earne
d
Points
Lost
Points
Grader’s
Name
1 20
2 20
3 20
4 20
5 20
G T
A A E A
B B G B
C C 0 0 0 0 C
D D 1 1 1 1 D
E E 2 2 2 2 E
F F 3 3 3 3 F
GG 4 4 4 4 G
H H 5 5 5 5 H
I I 6 6 6 6 I
J J 7 7 7 7 J
K K 8 8 8 8 K
L L 9 9 9 9 L
M M M
N N N
O O O
P P P
Q Q Q
R R R
S S S
TTT
U U U
V V V
W W W
X X X
Y Y Y
Z Z Z
pf3
pf4
pf5

Partial preview of the text

Download Practice Quiz 1 - Computing for Engineers | CS 1371 and more Quizzes Computer Science in PDF only on Docsity!

NOTE: You could lose five points if this page is not completed correctly! Academic misconduct (including, but not limited to, the list below) could result in a zero on this exam, an F grade in the course, and/or other disciplinary action:  Communication with anyone other than a proctor for ANY reason in ANY language in ANY manner.  Sharing of ANYTHING (e.g. pencils, paper, erasers).  Writing on paper that is not given to you by a proctor.  Cell phones, beepers, hand-held computers, calculators, etc. in your possession during the exam.  Failure to follow directions given by the proctor.  Failure to stop writing when the allowed time is up (as reported by the proctor).  Using books or other reference material.  Disruption of the exam setting.  Print your GT number in the spaces provided, and shade the boxes of the corresponding numbers and letters. By taking this exam, you signify that it is your work and that you have neither given nor received inappropriate help during the taking of this exam in compliance with the Academic Honor Code of Georgia Tech. Name (Print): Signature: TA’s Name: Proble m Possibl e Points Earne d Points Lost Points Grader’s Name 1 20 2 20 3 20 4 20 5 20

G T

A A E A B B G B C C 0 0 0 0 C D D 1 1 1 1 D E E 2 2 2 2 E F F 3 3 3 3 F G G 4 4 4 4 G H H 5 5 5 5 H I I 6 6 6 6 I J J 7 7 7 7 J K K 8 8 8 8 K L L 9 9 9 9 L M M M N N N O O O P P P Q Q Q R R R S S S T T T U U U V V V W W W X X X Y Y Y Z Z Z

  • TOTAL
    • Page 2 of

Problem 2 (20 points total) Write a Matlab function named cellArrayContents which takes in a cell array named A. The cell array will have one dimension. For each index in the cell array, determine whether the contents at that index are numeric, another cell array, a double, or other. This function will return a cell array named B. If the contents at index n of A are numeric, then the value at index n of B should be: “It’s NUMERIC!!” If the contents at index n of A are a double, then the value at index n of B should be: “It’s a DOUBLE!!” If the contents at index n of A are another cell array, then the value at index n of B should be: “It’s a CELL ARRAY!!” If none of the above three are true, the value at index n should be “OTHER” Problem 3 (20 points total) Write a script that will perform the following tasks: 1.) Plot Page 4 of 7

y = e^(4x-x

2

) * cos(x)

With 10 evenly spaced data points between 0 and 2 pi 2.)Make your plot a solid red line with downward pointing triangles at the data points 3.)Give your plot the title of “I LOVE CS1371” Problem 4 (20 points total) Show ALL of the steps when quick-sort is used to sort the following array: [6 4 1 3 9 7 5 2 8] Page 5 of 7

containing the thickness measurements at a given x location. The last (52nd) row contains the y locations where the measurements were made. PROBLEM : you must create a Matlab script that will: (a) read the data from the text file into an array, (b) construct the necessary x and y plaids and the z (thickness) array, (c) construct a surface plot of this data using the default coloring, and (d) label the x and y axes with strings ‘X’ and ‘Y’ and the z axis with the string ‘THICKNESS’. NOTE : Here is a sample of the file: 0.234 9.28 9.12 9.45 … (total of 42 columns) 2.123 9.22 9.01 8.76 … 4.333 8.12 8.43 … (coating thickness in col’s 2-42) … Row 52 (last): 101.2 -10.23 -9.18 -8.12 -7.10 … (these are the y locations) (The next page has been provided for writing this problem) Page 7 of 7