COMP 2011 Final Exam - Spring 2018 - HKUST
10 Questions
2 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

True or false: This exam is open book and open notes?

True

True or false: Electronic devices are allowed in this exam?

False

True or false: Students are allowed to define additional helper functions or structures for programming questions?

False

True or false: The total number of questions in this exam is 5?

<p>True</p> Signup and view all the answers

True or false: All programming codes in the answers must be written in ANSI C++ version?

<p>True</p> Signup and view all the answers

Explain how you can effectively pass back two numbers in a C++ function.

<p>You can pass back two numbers effectively in a C++ function by using pass by reference or pass by array.</p> Signup and view all the answers

Given the array const int SIZE = 5; int arr[SIZE] = {3, 6, 4, 6, 7}; and the void swap(int& a, int& b) function which swaps two variables’ values, what will the above array contain when the following code segment is executed?

<p>The array will contain {6, 3, 6, 4, 7} after the code segment is executed.</p> Signup and view all the answers

Explain the instruction regarding the use of electronic devices in the exam.

<p>No electronic devices are allowed in the exam.</p> Signup and view all the answers

What are the restrictions for writing programming codes in the answers?

<p>All programming codes in the answers must be written in the ANSI C++ version as taught in the lectures. Students are not allowed to define additional helper functions or structures, nor use global variables unless otherwise stated. They also cannot use any library functions not mentioned in the questions.</p> Signup and view all the answers

How many questions are there in the exam?

<p>There are 5 questions in the exam.</p> Signup and view all the answers

Study Notes

Exam Format

  • Exam format is open book and open notes.
  • Electronic devices are not allowed during the exam.
  • Students are permitted to define additional helper functions or structures for programming questions.
  • The total number of questions in the exam is 5.

Programming Guidelines

  • All programming codes in answers must adhere to ANSI C++ standards.
  • To effectively pass back two numbers in a C++ function, use reference parameters to allow the function to modify the original values.

Array and Function Example

  • Given the array const int SIZE = 5; int arr[SIZE] = {3, 6, 4, 6, 7}; and the void swap(int &a, int &b) function, the array will reflect the changes after the swap operation is executed, altering the values at specified indices.

Electronic Devices Policy

  • Strict instruction prohibits the use of electronic devices during the exam.

Programming Code Restrictions

  • Students must comply with ANSI C++ standards for their programming code submissions.

Exam Structure

  • The exam consists of a total of 5 questions.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Description

Prepare for the COMP 2011 final exam with this practice test based on the Spring 2018 exam paper from HKUST. The exam covers various topics including programming in ANSI C++. Get ready to test your knowledge in a simulated exam environment.

More Like This

Use Quizgecko on...
Browser
Browser