Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  


Shop
Java All : Function overloading


Exam Paper Problems

Function Overloading – Volume #7194

( As In Exam - ICSE2018 )

Design a class to overload a function volume() as follows:

(i) double

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

Function Overloading – Area #7431

( As In Exam - ICSE2014 )

Design a class to overload a function area() as follows:
(i) double are

Design a class to overload a function area() as follows:
(i) double area(double a. double b, double e) with three double arguments, returns the
area of a scalene triangle using the formula:

where

(ii) double area(int a, int b, int height) with three integer arguments, returns the area of a trapezium using the formula:

(iii) double area(double diagonal1, double diagonal2) with two double arguments, returns
the area of a rhombus using the formula:



Exam Paper Problems:2 
Back