Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class TrapezoidArea {
- public static void main(String[] args) {
- Scanner console = new Scanner(System.in);
- Double a = Double.parseDouble(console.nextLine());
- Double b = Double.parseDouble(console.nextLine());
- Double h = Double.parseDouble(console.nextLine());
- Double area = h * (a + b) / 2;
- System.out.println(area);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement