Advertisement
Georgi_G

More Exercises:Trapeziod Area

Apr 9th, 2020
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class TrapeziodArea {
  6.     public static void main(String[] args) {
  7.         Scanner scan = new Scanner(System.in);
  8.         int b1 = Integer.parseInt(scan.nextLine());
  9.         int b2 = Integer.parseInt(scan.nextLine());
  10.         int h = Integer.parseInt(scan.nextLine());
  11.         double area=(b1+b2)*h/2.0;
  12.         System.out.printf("%.2f",area);
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement