{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Chapter03-SampleQu879estions

Chapter03-SampleQu879estions - Sample Multiple Choice...

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

View Full Document Right Arrow Icon
BCEE 231 Chapter 3 - Sample questions 1 Sample Multiple Choice Questions – Chapter 3 In Part 1: Consider carefully each question, and select the best answer In Part 2: Write the answer number and its reason or justification. Part 1. Note: Line numbers are added for reference only The situation In relation to the situation at left 1. User-defined functions ONE of the following statements is FALSE. Which one? a) Any function other than main() must be invoked by name for it to be executed. b) As user-defined functions are optional, a program need not have any function. c) Function name must be followed by parentheses which enclose optional function arguments. d) Function arguments must match the type of parameters declared inside the function definition. e) Execution of ‘return’ inside the function body will transfer control back to the calling expression. ____________ f) None of the above 2. Consider the following program: 1. main() 2. { 3. A = HYPOT(3, 4); 4. print(A); 5. } 6. HYPOT( float a, float b) 7. { 8. float L; 9. L = sqrt (a*a+b*b); 10. return L; 11. } When the program executes, ONE of the following statements in relation to the results or program is FALSE. Which one? a) At line 4, ‘A’ is 5. b) At line 8, ‘a’ is 3 and ‘b’ is 4. c) At line 8, ‘L’ is 0 or possibly undefined d) At line 10, ‘L’ is 5 e) At line 4, ‘a’ is 3 and ‘b’ is 4 ____________ f) None of the above 3. Consider the following program: When the program executes, ONE of the
Image of page 1

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

View Full Document Right Arrow Icon
BCEE 231 Chapter 3 - Sample questions 2 1. main () { 2. float a = 1;
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