galinyotsev123

ProgBasicsJavaBook2.1SimpleCalculations05TrapeziodArea

Jan 25th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  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. double area = (b1 + b2) * h / 2.0;
  11. System.out.println("Trapezoid area = " + area);
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment