1
Answer

Overloading class members and operators

darren Wright

darren Wright

17y
1.9k
1

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)