Hi!!!
How Are you
I bring a new program which I have solve it ; but there are 7 error without explain
please I hope that I have any body to help me and I will be happy
thhhhhanks alot :)
This is the question
Consider the following class definition:
class Section{ private :
int Sec; //section number.
int count; //number of the students in the section. long *IDs; //IDs of students in the section.
int maxSize // Variable to store the maximum size of ----------------IDs ( students) in the section
public:
Section (const Section & another); Section (int, int ,int);
void addlD(long);
int getCount ( ) ;
void print( ) const;
~Section ( ) ;}
- Write the definition of class Section (above class) in a header file called “section.h”.
- Complete the above class by writing the definitions of all member functions in another file (impClass.cpp) and include the header file “section.h”.
a. The Constructor function Section (int, int int) ; initializes the data member Sec , count and maxsize and allocates dynamically one dimensional array pointed by IDs.
b. The Constructor function Section (const Section & another); should copy the content object another to the current object. (copy constructor).
c. The Function addID should add an ID at the end of the array.
d. The function getCount should return the number of students in the section.
e. The function print should prints all students IDs in the section.
f. A Destructor function to destroy all dynamically allocated memory - write the main program that tests the above class in another file (your-group-number.cpp) and include the-header file "section.h".
Main should include the following:
1) Create an instance ( object) named Sec1 of type Section with sec=1, count=0 and maxSize =20.
2) Write a statement to add the id 111 to Sec1.
3) Write a statement to add the id 222 to Sec1.
4) Write a statement to print the details of Sec1.
5) Create an instance ( object) named Sec2 of type Section with the same IDs of Sec1 using the copy constructor.
6) Write a statement add the id 333 to Sec1.
7) Write a statement to print the details of Sec2.