galinyotsev123

ProgBasics02Simple-Operations-P10Birthday

Jan 11th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class P10Birthday {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in );
  6.  
  7. int a = Integer.parseInt(scanner.nextLine());
  8. int b = Integer.parseInt(scanner.nextLine());
  9. int h = Integer.parseInt(scanner.nextLine());
  10. double parcentages = Double.parseDouble(scanner.nextLine());
  11.  
  12. int area = a * b * h;
  13.  
  14. double totalLitres = area * 0.001;
  15. double result = totalLitres - (totalLitres * parcentages /100 );
  16.  
  17.  
  18. System.out.printf("%.3f", result);
  19.  
  20.  
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment