Advertisement
Guest User

Untitled

a guest
May 25th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. package DataTypesVarsEx2405;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Problem8beerKegs {
  6. public static void main(String[] args) {
  7. Scanner scanner = new Scanner(System.in);
  8. int n = scanner.nextInt();
  9. String biggestKegModel = "";
  10. for (int i = 0; i<n; i++) {
  11. double topVolume = 0;
  12. for (int x = 0; x<3; x++) {
  13. String currentModel = scanner.nextLine();
  14. double currentRadius = Double.parseDouble(scanner.nextLine());
  15. int height = scanner.nextInt();
  16. double currentVolume = Math.PI*Math.pow(currentRadius, 2)*height;
  17. if (currentVolume>topVolume) {
  18. biggestKegModel=currentModel;
  19. }
  20. }
  21. }
  22. System.out.println(biggestKegModel);
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement