Question: Question 3 (25 marks) Implement a C program that helps to explain the syntax and the use of data structures such as arrays and pointers.

 Question 3 (25 marks) Implement a C program that helps to

Question 3 (25 marks) Implement a C program that helps to explain the syntax and the use of data structures such as arrays and pointers. These data structures form part of the data members and constructors in a C++ class. (a) Declare the data members of Competition class as follows: (i) (ii) (iii) Astring representing the title of the competition. An integer representing the number of players in the competition. A dynamic location large enough to store the names of the players in the competition. The location is reference by a pointer string* players (iv) A dynamic location large enough to store the scores of the players in the competition. The location is reference by a pointer string scores (4 marks) (b) Implement an application using the C language in an object-oriented style Constructors and destructor are used to initialise and remove objects in an object oriented manner. You are asked to write the following constructors to initialise a Competition object and a destructor to remove it from memory (5 marks) (ii) A default constructor (4 marks) (Assuming the competition has at least three players, you may use any valid default values for the title, players and scores) (iii) A copy constructor (6 marks) (iv) A destructor (2 marks) Write a main() function to demonstrate how the constructors in part (b) are being (4 marks) (c) used

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!