Overloading class members and operators

Oct 22 2007 3:00 PM

Hi ALL

I was given 2 questions. But have little clue what to do. Please anyone help me.

1) Write a class with an overloaded method used to add numbers.One method should have 2 integer parameters, and the other should take the numbers as a parameter. Use both methods in an example and write the results to the console.

2) Write a class, Item, used to store an item's name and its price. Now write a class PriceList which stores an array of 5 items. Overload the multiplication(*) operator in this class to multiply every item in the price list by the provided amount.

 

 


Answers (1)