Computer Science, asked by richamishra207, 6 months ago

write a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in java​

Answers

Answered by anindyaadhikari13
18

Question:-

➡Write a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in java.

Program:-

import java.util.*;

class Area

{

void area(int base, int height)

{

double a=0.5*base*height;

System.out.println("Area of the Parallelogram is: "+a);

}

void area(double d1, double d2)

{

double a=0.5*d1*d2;

System.out.println("Area of the Rhombus is: "+a);

}

void area(double h, double a, double b)

{

double A=0.5*h*(a+b);

System.out.println("Area of the trapezium is: "+A);

}

public static void main(String args[])

{

Area obj=new Area();

obj.area(2,3);

obj.area(20.0,50.0);

obj.area(10.0,20.0,20.0);

}

}

Answered by swathasingh
2

Answer:

yeahboi

Explanation:

write a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in javawrite a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in javawrite a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in javawrite a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in javawrite a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in java

yeahboi

write a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in javawrite a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in javawrite a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in javawrite a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in javawrite a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in java

yeahboi

write a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in javawrite a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in javawrite a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in javawrite a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in javawrite a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in java

yeahboi

write a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in javawrite a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in javawrite a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in javawrite a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in javawrite a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in java

yeahboi

write a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in javawrite a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in javawrite a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in javawrite a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in javawrite a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in java

yeahboi

write a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in javawrite a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in javawrite a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in javawrite a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in javawrite a class with the name area using function overloading that computes the area of parallelogram, rhombus and trapezium in java

yeahboi

write a class with the name area using function using

Similar questions