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