Problem Statement - Function Overloading – Volume
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 R^3
(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 R^2 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
Solution
CSKC| Created: 12-Apr-2019 | Updated: 26-Nov-2019|ICSE2018