SHARE
TWEET

Untitled

a guest Dec 6th, 2019 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Scanner s = new Scanner (System.in);
  2.        
  3.        
  4.          int n, m;
  5.  
  6.         System.out.print("Max Radius: ");
  7.         n = s.nextInt();
  8.         System.out.print("Max Height: ");
  9.         m = s.nextInt();
  10.  
  11.         for (int r = 1; r <= n; r++) {
  12.             for (int h = 1; h <= m; h++) {
  13.                 System.out.printf("radius %d, height %d:\n", r, h);
  14.                 double v = (1 * (Math.PI * (r * r) * h) / 3);
  15.                 System.out.printf("volume: %.2f\n", v);
  16.             }
  17.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top