




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





(60 Minutes)
(Print: Last Name, First Name)
LECTURER___________ WORKSHOP: CRN _____________LEADER_________________
(Signature)
Complete the following items and darken appropriate circles on your op-scan: NAME Last, First ID NUMBER Your VT number that starts 90… FORM Test form SEAT NO The last 3 digits of your CRN. Incompletely or incorrectly filling out this information on the OPSCAN will result in a 5 point deduction to your test grade.
This test is closed book and closed notes.
This test is 100% multiple-choice. Select the BEST response.
Circle your response on the test form and record your answers on the op-scan sheet. The op-scan form will not be returned to you. Additional time at the end of the test will NOT be allowed to fill in your op-scan form.
This test, in its entirety, counts towards your programming average for ENGE 1114. A 60% average on all programming assignments is required to pass this course.
Questions 1-4 refer to the algorithm in the flowchart at right
For questions 10-13 consider the four flowchart segments below:
X > 100^ if
inputX T F
X < 0^ if T F
outputV
V = ‘Invalid”
V = ‘Invalid”
V = ‘Valid”
X > 100^ if
inputX T F
X<=100 and X >= 0^ if^ T F
outputV
V = ‘Invalid”
V = ‘Valid”
V = ‘Invalid”
if 0≤X and X≤
V = ‘INVALID’ V = ‘VALID’
input X
output V
T
F
-Code for Q14 and Q15-
1- N = input('\nEnter N: '); 2- for J = 1:1:N 3- X(J) = J+J; 4- end 5- fprintf('\n %f', X(J))
3- for K = 1:1:C 4- S(K) = input('Enter S'); 5- 6- fprintf( ' %12.2f %12.2f ' , K, S(K)) 7- end 8- fprintf(' T = %12.2f\n ', T)
2- for J = 1:1: 3- for K = J:1: 4- Q = Q + 1; 5- end 6- end
For problems 23-27 consider an algorithm that will create a table of surface area as a function of length for a cylinder that has a central hole cut through it along the length. The cross-sectional shape of the hole is a rectangle. Input to the algorithm is the cylinder diameter, d, and the cross-sectional dimensions, w and h, of the rectangular hole. The length of the object, L, must be allowed to vary from 1 to 5 inches in one-inch increments. Table columns must be the object length and surface area. Your algorithm must check input values and create the table only if the hole cross-sectional dimensions entered are each less than 50% of the entered cylinder diameter, and otherwise stop. You may not use vectors in your algorithm.
A = ππππ d^2 /4 B = w+h C = ππππ d D = w · h
w h^ L
d