Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package dataTypesAndVariables;
- import java.util.Scanner;
- public class P11RefactorVolumeOPyramid {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- System.out.print("Length: ");
- double length = Double.parseDouble(scanner.nextLine());
- System.out.print("Width: ");
- double width = Double.parseDouble(scanner.nextLine());
- System.out.print("Height: ");
- double height = Double.parseDouble(scanner.nextLine());
- double volume = (length * width * height) / 3;
- System.out.printf("Pyramid Volume: %.2f", volume);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement