Advertisement
tchenkov

P08_RefactorVolumeOfPyramid

May 31st, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. /**
  4.  * Created by todor on 3.05.2017 г..
  5.  */
  6. public class P08_RefactorVolumeOfPyramid {
  7.     public static void main(String[] args) {
  8.         Scanner scan = new Scanner(System.in);
  9.         System.out.print("Length: ");
  10.         double length = Double.parseDouble(scan.nextLine());
  11.         System.out.print("Width: ");
  12.         double width = Double.parseDouble(scan.nextLine());
  13.         System.out.print("Height: ");
  14.         double height = Double.parseDouble(scan.nextLine());
  15.         double pyramidVolume= (length * width * height) / 3;
  16.         System.out.printf("Pyramid Volume: %.2f", pyramidVolume);
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement