Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class lab5a2 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double num = scanner.nextDouble();
- System.out.println("The area of a square with a side length of " + num + " is " + Math.pow(num, 2));
- System.out.println("The volume of a sphere with a radius of " + num + " is " + (4/3) * Math.PI * Math.pow(num, 3));
- System.out.println("The side length of a square with an area of " + num + " is " + Math.sqrt(num));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment