2nd SEMESTER 2021/22 Resit Exam
Undergraduate – Year 2
C++ Programming and Software Engineering II
Exam Duration: 2 Hours
INSTRUCTIONS TO CANDIDATES
1、 This is an open book resit exam. Please complete the exam independently and honestly.
2、 The total marks available are 100.
3、 Answer all questions in the answer booklet and submit it to LMO. There is NO penalty for providing a wrong answer.
4、 The duration is 2 hours.
Q2 | Write C++ statements for each of the following tasks. | Total 10 | |
a) | Create a function that can create a double-type array with a variable size, and return the array pointer and obtain the size of the array. Initialize all elements to be 0 by using pointer-offset notations and save the array size into the reference parameter n. | (5) | |
b) | Create a function void sort( int a[], int n) to sort an array in descending order. | (5) |