Advertisement
MladenKarachanov

TrapeziodArea

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