Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Marcel Olszewski
- //October 27th, 2010
- import java.util.Scanner;
- public class SphereCalculations{
- public static void main(String [] args){
- Scanner radius = new Scanner(System.in);
- //input
- System.out.println("Enter radius, recieve volume & surface area");
- int RadiusInput = radius.nextInt();
- //output
- System.out.println("Volume = " + ((double)4/3*Math.PI*Math.pow(RadiusInput,3)) + "cm^3");
- System.out.println("Surface Area= " + (4*Math.PI*Math.pow(RadiusInput,2)) + "cm^2");
- }//End of main method
- }//Close SphereCalculations
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement