Silviyaa

P11RefactorVolumeOfPyramid

May 27th, 2021
733
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class P11RefactorVolumeOfPyramid {
  4.     public static void main(String[] args) {
  5.             Scanner scanner = new Scanner(System.in);
  6.         double Length, Width, Height = 0;
  7.  
  8.         System.out.print("Length: ");
  9.         Length = Double.parseDouble(scanner.nextLine());
  10.         System.out.print("Width: ");
  11.         Width = Double.parseDouble(scanner.nextLine());
  12.         System.out.print("Height: ");
  13.         Height = Double.parseDouble(scanner.nextLine());
  14.         Height= (Length + Width + Height) ;
  15.         System.out.printf("Pyramid Volume: %.2f", Height);
  16.  
  17.     }
  18. }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment