Starting from:

$39.99

CS2273 Assignment 3 (Part 1): Class and Object concepts using C++ Solution



Develop the below mentioned programs using C++. Apply following features wherever applicable.
• All C++ concepts as mentioned in “Assignment 2” and the following
• Access Specifier
• Constant data member
• Default Constructor
• Overloaded Constructor
• Copy Constructor
• 'this' pointer
• Assignment(=) operator
• Static member/member function
• Operator overloading : addition(+) operator
• Class Template
Problems
1. Write a program to take input of N number of students information such as Name,
Age, Department and Year. The student information should be shored in array of Student Class. Print those information in the console. Develop member functions
of Student Class such as ReadStudentData(...), PrintStudentData(...) for this purpose.

2. Develop a program that supports functionalities of a variable length 1-D array. Let us call it RuntimeSizeArray (RSA). The RSA is supposed to be initialized with some predefined initial size to store integer elements. If the space in RSA is exhausted by populating elements, it inflates by adding extra space in it. However, RSA should have some upper bound of its size and once that is reached, RSA cannot inflate any more. Note that linklist shouldn’t be used in this program.
• Create a RuntimeSizeArray class named RSArray with required data members and member functions. Note that each array can have different maximum size based on initialization.
• Develop the following routines as member function of the class
 addElem(...) : Add/update element(s) into the array
 fetchElem(...) : Obtain an element from the array of a desired location  inflate(...): Inflates the array size by adding extra space in it.
 resetElements(...): Reset N number of elements from a given index of the array
 getMaxSize(...) : Should notify the maximum number of elements the array can store
 getCount(...) : Should notify the current number of elements in the array
• Demonstrate the basic array functionality using above routines
• Demonstrate that multiple array can be instantiated and can co-exists independently
• Demonstrate that a new array can be created from an existing class using “copy constructor”
• Demonstrate that an existing array content can be updated from the content of another array using “=” operator.

3. Modify the Problem 2 to implement a generic RuntimeSizeArray to store any kind of data types such as int, short, float, double or struct using class template concept.

4. Implement problem number 5 or 8 (based on whichever you have done earlier) from assignment number 2 using the concept of class.

More products