Check out example codes for "area and perimeter of trapezium in java". It will help you in understanding the concepts better.

Code Example 1

import java.util.*;
public class AreaAndPerimeterOfTrapezium
{
   public static void main(String[] args)
   {
      float a = 6;
      float b = 14;
      float c = 10;
      float d = 5;
      float h = 21;
      float area = (float) (0.5 * (a + b) * h);
      // a, b, c and d are sides of trapezium
      float perimeter = a + b + c + d;
      System.out.println("area of trapezium is: " + area);
      System.out.println("perimeter of trapezium is: " + perimeter);
   }
}

Learn ReactJs, React Native from akashmittal.com