1. Homepage
  2. Exam
  3. [2021] UOW - CSCI251 Advanced Programming - C++ - Final Exam - Part A

[2021] UOW - CSCI251 Advanced Programming - C++ - Final Exam - Part A

This question has been solved
Engage in a Conversation

Part A: 16 questions worth 1mark each. (Total 16 Marks) 


  CourseNana.COM

1) What do exceptions allow us to separate? Give an example of when this separation is appropriate. CourseNana.COM

  CourseNana.COM

2) Explain what the idea that main() should tell a story means, particularly in procedural programming. CourseNana.COM

  CourseNana.COM

3) Function swapTwo() below is used by which method: pass by value or pass by reference? Explain what is the main difference between two methods. CourseNana.COM

void swapTwo(int& a, int& b){ CourseNana.COM

int tmp = a; CourseNana.COM

a = b; CourseNana.COM

b = tmp; CourseNana.COM

} CourseNana.COM

4) How many types of overloading in C++? Give examples to illustrate. CourseNana.COM

  CourseNana.COM

5) The following code segment fails to initialize the array elements to 1. State the usage of the keyword auto. Rewrite the code segment so that it could work. CourseNana.COM

  CourseNana.COM

int *ptr = new int[7]; CourseNana.COM

for(auto& x : ptr) CourseNana.COM

x = 1; CourseNana.COM

6) Show two ways to insert “comments” in C++ code CourseNana.COM

  CourseNana.COM

7) An array name is often considered as a “constant pointer”  to an array. Consider the following statements and state whether there is any difference in terms of the byte size of ptr1 and ptr2. CourseNana.COM

  CourseNana.COM

int ptr1[5]; CourseNana.COM

int * const ptr2 = new int[5]; CourseNana.COM

8) What a loop in C++ is used for and when you would use one? CourseNana.COM

  CourseNana.COM

9) What is the role of a makefile? How to produce a makefile? CourseNana.COM


10) What are the roles of constructors and destructors, related to the lifetime of an object? Give an example header for a constructor and destructor for a class X. CourseNana.COM


CourseNana.COM

11) How do static and dynamic libraries differ? Give one advantage of using each. CourseNana.COM

  CourseNana.COM

12) What does it mean to provide .h and .o files to a “client”? Why would we do this? CourseNana.COM

  CourseNana.COM

13) State one advantage of smart pointers (not iterators from STL) over regular pointers. CourseNana.COM

  CourseNana.COM

14) Explain the idea of class templates being blueprints of blueprints. CourseNana.COM

  CourseNana.COM

15) Describe a scenario where the use of an STL vectormakes more sense than the use of an STL CourseNana.COM

deque, STL set or STL map. Justify your answer. CourseNana.COM

  CourseNana.COM

16) Describe advantages of using a container class rather the classical array. CourseNana.COM

Get the Solution to This Question

WeChat WeChat
Whatsapp WhatsApp
C++代写,STL代写,Overload代写,Constant Pointer代写,Lifetime of Object代写,Static and Dynamic Library代写,C++代编,STL代编,Overload代编,Constant Pointer代编,Lifetime of Object代编,Static and Dynamic Library代编,C++代考,STL代考,Overload代考,Constant Pointer代考,Lifetime of Object代考,Static and Dynamic Library代考,C++help,STLhelp,Overloadhelp,Constant Pointerhelp,Lifetime of Objecthelp,Static and Dynamic Libraryhelp,C++作业代写,STL作业代写,Overload作业代写,Constant Pointer作业代写,Lifetime of Object作业代写,Static and Dynamic Library作业代写,C++编程代写,STL编程代写,Overload编程代写,Constant Pointer编程代写,Lifetime of Object编程代写,Static and Dynamic Library编程代写,C++programming help,STLprogramming help,Overloadprogramming help,Constant Pointerprogramming help,Lifetime of Objectprogramming help,Static and Dynamic Libraryprogramming help,C++assignment help,STLassignment help,Overloadassignment help,Constant Pointerassignment help,Lifetime of Objectassignment help,Static and Dynamic Libraryassignment help,C++solution,STLsolution,Overloadsolution,Constant Pointersolution,Lifetime of Objectsolution,Static and Dynamic Librarysolution,