Question:
Design a class to overload a function volume() as follows:
(i) double volume (double R) ยกV with radius (R) as an argument, returns the volume of sphere using the formula.
V = 4/3 x 22/7 x R3
(ii) double volume (double H, double R) ยกV with height(H) and radius(R) as the arguments, returns the volume of a cylinder using the formula.
V = 22/7 x R2 x H
(iii) double volume (double L, double B, double H) ยกV with length(L), breadth(B) and Height(H) as the arguments, returns the volume of a cuboid using the formula.
V = L x B x H
C. Sir| Created: 12-Apr-2019 | Updated: 12-Apr-2019|ICSE2018
