SHARE
TWEET

Homework (Trapec)

MilaDimitrovaa Oct 18th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class Trapec1 {
  4.  
  5.     public static void main(String[] args) {
  6.        
  7.         Scanner scan = new Scanner (System.in);
  8.         double a = scan.nextDouble();
  9.         System.out.println("a:" + a );
  10.         double b = scan.nextDouble();
  11.         System.out.println("b:" + b );
  12.         double h = scan.nextDouble();
  13.         System.out.println("h:" + h );
  14.         double S = (a + b) / 2 *h;
  15.         System.out.println("S=" + S);
  16.        
  17.        
  18.     }
  19.  
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top