Welcome! Log In Create A New Profile


Assignment 2 Question 5

Posted by esckay 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Assignment 2 Question 5
April 04, 2006 11:02PM

Has anyone started with this question? Are we suppose to use the STL stack or build our own?

In this question they specify that the destructor must dynamically deallocate memory, now if you are using the STL stack, will your classes destructor not automatically invoke the STL stack destructor once it goes out of scope?

Another question on the STL stack ... is it array based or linked list based ?

And a final question on the myunisa forum .... when is it going to work ?

Re: Assignment 2 Question 5
April 04, 2006 11:14PM
Just one more thing, if the stack must be a linkedStack, then I presume that it must be of type string ... since you are suppose to use the parenthesis onto the stack ?
avatar Re: Assignment 2 Question 5
April 07, 2006 05:16PM
Hi Escay

Great to see you're back this year.

You're worrying too much about the implementation. Think more in terms of objects and contracts.

The class' interface tells you what it can do for you and what it must expect from you - this is the contract that the developer of the stack class has agreed to. HOW the contract is fulfilled on his/her side is irrelevant and what you use the class for on your side is irrelevent to the class developer.

You are correct, when your class is destroyed, the STL class is destroyed as well (assuming it's not dynamically created) and it's destructor is called automatically.

It is irrelevant how the STL stack is implemented. It should be enough to know that it does its job correctly.

hehe, the myUnisa discussion fora will not be used this year by the computer department. See the Social Café forum on Osprey for more about that.

Re: Assignment 2 Question 5
April 08, 2006 01:54PM
Hi Rob,

Thanks for the info. This question was a bit of a mission as the description that they give for the step E it not the greatest at all !!, but I finally got the program to work.

Sorry, only registered users may post in this forum.

Click here to login