perimeter of parallelogram in java

Solutions on MaxInterview for perimeter of parallelogram in java by the best coders in the world

showing results for - "perimeter of parallelogram in java"
Leighton
14 Mar 2017
1import java.util.Scanner;
2public class PerimeterOfParallelogram
3{
4   public static void main(String[] args)
5   {
6      Scanner sc = new Scanner(System.in);
7      System.out.println("Please enter length of adjacent side of parallelogram: ");
8      double a = sc.nextDouble();
9      System.out.println("Please enter another length of adjacent side of parallelogram: ");
10      double b = sc.nextDouble();
11      double perimeter = 2 * (a + b);
12      System.out.println("perimeter of parallelogram is: " + perimeter);
13      sc.close();
14   }
15}