Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. //Marcel Olszewski
  2. //October 27th, 2010
  3.  
  4. import java.util.Scanner;
  5.  
  6. public class SphereCalculations{
  7. public static void main(String [] args){
  8. Scanner radius = new Scanner(System.in);
  9. //input
  10. System.out.println("Enter radius, recieve volume & surface area");
  11. int RadiusInput = radius.nextInt();
  12. //output
  13. System.out.println("Volume = " + ((double)4/3*Math.PI*Math.pow(RadiusInput,3)) + "cm^3");
  14. System.out.println("Surface Area= " + (4*Math.PI*Math.pow(RadiusInput,2)) + "cm^2");
  15. }//End of main method
  16. }//Close SphereCalculations
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement