sample_mt2 - Notes about this examination Comp120 Sample...

Info icon This 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
Image of page 1

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

View Full Document Right Arrow Icon
Comp120 Sample Term Test #2 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.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern