Page 1 of 1
Implement a C++ program that demonstrates the appropriate syntax for constructing data structures such as arrays and poi
Posted: Sat Nov 27, 2021 2:35 pm
by answerhappygod

- Implement A C Program That Demonstrates The Appropriate Syntax For Constructing Data Structures Such As Arrays And Poi 1 (30.89 KiB) Viewed 77 times

- Implement A C Program That Demonstrates The Appropriate Syntax For Constructing Data Structures Such As Arrays And Poi 2 (20.19 KiB) Viewed 77 times
Implement a C++ program that demonstrates the appropriate syntax for constructing 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 Student class as follows: 1 A string representing the name of the student. An array of eight chars representing the student id number. () (ii) An integer representing the number of modules the student is taking. (iv) A dynamically allocated location large enough to store the names of the modules that the student is taking. The location is referenced by a pointer string* modules. (4 marks) (6) 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 Student object and a destructor to remove it from memory.
You are asked to write the following constructors to initialise a Student object and a destructor to remove it from memory. (1) A parameterised constructor (5 marks) (11) A default constructor (Assuming the student takes more than one module, you may use any valid default values for the name, id number and modules) (4 marks) (111) A copy constructor (6 marks) (iv) A destructor (2 marks) Write a main() function to demonstrate how the constructors in part 6) are being used. (4 marks)