Welcome! Log In Create A New Profile

Advanced

Assignment 2 Question 1

Posted by cheten 
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 1
February 11, 2011 10:04AM
Hi there ;
1- anyone with knowledge of the output of assignment 2 question 1;
2- how do you call m_Transactions in the Transaction class - i am confused here
3- How to access private data members of the class Transaction so that m_NoOfItems in this class are the sme as the m_NoOfItems in the class Product.
avatar Re: Assignment 2 Question 1
February 11, 2011 03:14PM
You are not meant to access protected or private members from outside the class, that's why they're marked that way. Try thinking of a different way to solve the problem without using those members.
Re: Assignment 2 Question 1
March 02, 2011 11:26AM
hey guys... when i try calling Product::sell() in ProdutList i get an error saying cannot call member function without object... not sure what to doconfused smiley
avatar Re: Assignment 2 Question 1
March 03, 2011 08:06AM
The function you're calling can't be a static function then. Check your syntax or post the line + 5 lines above and 5 lines below.
Re: Assignment 2 Question 1
March 03, 2011 10:08AM
thank you... yeah the syntax was wrong.Im also confused with the transaction class...how do i declare it in the Product class
Re: Assignment 2 Question 1
March 14, 2011 07:55PM
I need help with the productlist section of the question. With the add function, I have no problem accessing the data members of the product you want to add. But how do you access the product code for example if you want to check if it is already been used?
avatar Re: Assignment 2 Question 1
March 18, 2011 11:43AM
Use the getProductCode() function...
avatar Re: Assignment 2 Question 1
March 20, 2011 11:37AM
What is I missing?
I see no data members in ProductList.

Do you make some up? to store the list

edit:
I created a ProductList in client code. thumbs up smiley

_____________________________________
The sun is always shining, but it is far away.
avatar Re: Assignment 2 Question 1
March 20, 2011 09:09PM
Quote

3- How to access private data members of the class Transaction so that m_NoOfItems in this class are the sme as the m_NoOfItems in the class Product
I think the UML is missing the Transaction constructor, so I added one.
How else can you populate with the correct values?

_____________________________________
The sun is always shining, but it is far away.
Sorry, only registered users may post in this forum.

Click here to login