subject

The size data member is assigned numEvents. The events data member has its elements assigned to be nullptr. setEvents: This function takes in an int variable s and an Event* const array named newEvents. Assign s to size. Copy the elements from newEvents to our events array. Each element of the events array must be assigned new addresses before copying the newEvents element's events. You should check what other's event element type is to properly assign a new address for either Birthday or Concert. Since the newEvents array is an Event* const array, you must cast the dereferenced element into either a Birthday or Concert reference when copying from newEvents' array. Destructor The destructor must free up the memory that the pointers have used. Hint: You must loop through the events array and delete each element as each element is a pointer. Make sure they are not nullptr before deleting. Copy Constructor: you must do a memberwise copy of of size, numBd, numC, time, and date. Finally, you may use the setEvents function to initialize the events array. Copy Assignment Operator: similar to the copy constructor, make sure to assign events based on their type. eventsFromInput: this function is provided for you. This function is what will be getting the event information from standard input. They are not ordered by time or date.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:30
Consider the following statements: #include #include class temporary { private: string description; double first; double second; public: temporary(string = "", double = 0.0, double = 0.0); void set(string, double, double); double manipulate(); void get(string& , double& , double& ); void setdescription(string); void setfirst(double); void setsecond(double); }; write the definition of the member function set() so that the instance variables are set according to the parameters. write the definition of the constructor so that it initializes the instance variables using the function set() write the definition of the member function manipulate() that returns a decimal number (double) as follows: if the value of description is "rectangle", it returns first * second if the value of description is "circle" it returns the area of a circle with radius first if the value of description is "cylinder" it returns the volume of a cylinder with radius first and height second. hint: the volume of a cylinder is simply the area of the circle at the base times the height. if the value of description is "sphere" it returns the volume of the sphere with radius first. otherwise it returns -1.0;
Answers: 1
question
Computers and Technology, 23.06.2019 05:30
Sally is editing her science report about living things. she needs to copy a paragraph from her original report. order the steps sally needs to do to copy the text to her new document.
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
Idon’t understand the double8 coding problem. it is java
Answers: 1
question
Computers and Technology, 24.06.2019 07:00
Selective is defined as paying attention to messages that are consistent with one’s attitudes and beliefs and ignoring messages that are inconsistent.
Answers: 1
You know the right answer?
The size data member is assigned numEvents. The events data member has its elements assigned to be n...
Questions
question
Mathematics, 20.03.2020 10:12
question
Mathematics, 20.03.2020 10:12