Advertisement
desislava_topuzakova

05. Trapeziod Area

Apr 22nd, 2018
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.42 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class GreetingByName {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         double a = Double.parseDouble(scanner.nextLine());
  8.         double b = Double.parseDouble(scanner.nextLine());
  9.         double h = Double.parseDouble(scanner.nextLine());
  10.  
  11.         double area = 0.5 * (a + b) * h;
  12.         System.out.println(area);
  13.  
  14.  
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement