Advertisement
Spocoman

01. Trapeziod Area

Aug 19th, 2024 (edited)
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.43 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class TrapeziodArea {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         double b1 = Double.parseDouble(scanner.nextLine());
  7.         double b2 = Double.parseDouble(scanner.nextLine());
  8.         double h = Double.parseDouble(scanner.nextLine());
  9.  
  10.         double result = (b1 + b2) * h / 2;
  11.  
  12.         System.out.printf("%.2f", result);
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement