Computer Science, asked by akshay6280, 6 months ago

consider fruit basket with number of apples & number of mangoes as data members .Overload the + operater to add two objects of this class

Answers

Answered by waizayas1234
0

Explanation

A fruit basket contains 4 oranges, 5 apples and 6 mangoes. The number of ways a person make selection of fruits from among the fruits in the basket is?

ANSWER

Whenever it is not explicity mentioned that fruit and distint, We take them as identical. 0 or more orange can be selected from 4 identical oranges in (4+1)=5 ways. 0 or more apples can be selected from 5 identical apples in (5+1)=6 ways.

0 or more mangoes can be selected from 6 identical mangoes in 7 ways.

∴ Total no. of ways in which all of three types of fruits can be selected (the no. of any type of fruits may also be 0),

5×6×7=210,

But in these 20 selection, there is one selection where all fruits are 0, hence we reduce 1 selection.

∴ the required no. =210−1=209

Similar questions