Question: SECTION B [ 4 5 Marks ] Question 1 is compulsory, answer any 2 of the other 3 questions in this section Question 1 [
SECTION B Marks
Question is compulsory, answer any of the other questions in this section
Question marksTHIS QUESTION IS COMPULSORY
A In the Standard Template Library, arrays and vectors are commonly used data structures. What is the key difference between arrays and vectors?
Mark
B Write a function called displayData that accepts a vector of integers, this function should display to the screen the maximum value, minimum value and the average of the numbers in the vector.
Marks
C A small number generator for primary school students requires you to write a C function that takes an integer as input and determines whether it is even or odd. If the input is even, the function should display all even numbers from to the input. If the input is odd, the function should display all odd numbers from to the input.
Allow the user to call on the function up to times, and each time store the integers provided in an array.
Your solution should show the call to the function and the return from the function in a small program. When the user is finished the program should display all of the integers provided.
Marks
Question marks
A Explain with examples the concepts of function overloading and function overriding within the context of objectoriented programming. Marks
B Describe composition in the context of objectoriented programming.
Marks
C Why is it common for a typical class in to include public accessors getters and mutators setters functions? Marks
D Given the following UML Class Diagram, write the class declaration and definition code. marks
tablePlayertablename : stringage : intscore : inttableplayerplayer: string, a : int
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
