Advertisement
gastaojunior

Untitled

Feb 4th, 2013
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1.  
  2. import javax.swing.JOptionPane;
  3.  
  4. public class t {
  5.     public static void main (String args[]) {
  6.         double r, v, vTemp;
  7.         Integer vTempInt,x;
  8.         r = Double.parseDouble(JOptionPane.showInputDialog(null, "Informe o valor da raio" ));
  9.         v =   4.0/3.0* Math.PI  * Math.pow(r, 3);
  10.         vTemp = v *100;    
  11.         vTempInt= (int)vTemp;
  12.         JOptionPane.showMessageDialog(null,"Valor anterior " + vTemp);
  13.         vTemp = vTempInt /100;
  14.         JOptionPane.showMessageDialog(null, "O valume da esfera de raio " + r + " e: "+ vTemp  );
  15.        
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement