Sample_mt2 - Notes about this examination Comp120 Sample Term Test#2 All code must be written in the programming language C Page 1 of 7 You have 80

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

View Full Document Right Arrow Icon
Notes about this examination All code must be written in the programming language C . You have 80 minutes to write this examination. No notes, books, or any type of electronic equipment is allowed including cell phones and calculators. Good luck! Comp120 Sample Term Test #2 Page 1 of 7 Capilano University COMP120 Sample Term Test #2 1. Section Mark Max 1 7 2 7 4 6 5 20 Total 40
Background image of page 1

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

View Full DocumentRight Arrow Icon
Page 2 of 7 Section 1 [7] True or False. Please circle the appropriate answer, T or F. T F 1 Each C program can contain only one user defined function. T F 2 All variables used in the program must be declared inside a function. T F 3 If the search array is sorted in the descending order, in order to search for a value in the array, we must use a linear search algorithm, i.e. binary search algorithm can not be modified for arrays sorted in descending order. T F 4 The value of an identifier is the portion of the program in which the variable is accessible (can be referenced). T F 5 Given the declaration int alpha [5] = {1,2,3,4,5}; int beta[5]; the statement beta = alpha; copies all elements of the array alpha into the array beta . T F 6. The C instruction a = rand() % 2.5 generates a pseudo random number in the range 0 to 2.5 inclusive. T F 7. FILE data.txt; is a valid C statement. Section 2 [7] Multiple choice. For each question circle exactly one choice. Multiple choice questions are worth
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/23/2010 for the course PHYSICS 114 taught by Professor Mike during the Spring '10 term at Capilano.

Page1 / 9

Sample_mt2 - Notes about this examination Comp120 Sample Term Test#2 All code must be written in the programming language C Page 1 of 7 You have 80

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online