Computer Science, asked by SourabhSM1, 8 months ago

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

(a) void area (int s) – to find the area of square

(b) void area (int l, int b) – to find the area of rectangle

(c) void area (double r) – to find the area of circle

Formula: Area of square = side * side

Area of rectangle = length * breadth

Area of circle = π

2

Answers

Answered by ruses
2

Answer:

Question 1

A function can return only one value to its caller program.

Question 2

If a function does not return any value its return type is void.

Question 3

A function indicating the function name, return type along with function arguments is known as function header/prototype.

Question 4

The variables used to receive the values in function header are known as formal parameters.

Question 5

Method in a Java program resides in package.

Similar questions
Math, 11 months ago