Advertisement
Guest User

Untitled

a guest
May 20th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1. package c01_Simple_Calculations;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class p08_TriangleArea {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner scan = new Scanner(System.in);
  9.  
  10.         int l = Integer.parseInt(scan.nextLine());
  11.         int w = Integer.parseInt(scan.nextLine());
  12.         int h = Integer.parseInt(scan.nextLine());
  13.         double percentage = Double.parseDouble(scan.nextLine());
  14.  
  15.         double volume = l * w * h;
  16.         volume *= 0.001;
  17.         volume  -= volume * (percentage / 100);
  18.  
  19.         System.out.printf("%.3f", volume);
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement