galinyotsev123

ProgBasics02Simple-Operations-P05TrapeziodArea

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