Soccer Ball Class

Main.java

public class Main {
    public static void main(String[] args) {
        // caleb b
        // soccer ball class
        Ball ball = new Ball(randomDouble(0, 64), randomDouble(0, 64), randomDouble(0, 64), randomDouble(0, 64), randomDouble(0, 64), randomDouble(0, 64));
        System.out.println(ball.posX);
        System.out.println(ball.posY);
        System.out.println(ball.posZ);
        System.out.println(ball.velX);
        System.out.println(ball.velY);
        System.out.println(ball.velZ);
    }
 
    public static double randomDouble(double min, double max) {
        return Math.random() * (max - min) + min;
    }
}

Ball.java

public class Ball {
    public double posX;
    public double posY;
    public double posZ;
    public double velX;
    public double velY;
    public double velZ;
 
    public Ball(double posX, double posY, double posZ, double velX, double velY, double velZ) {
        this.posX = posX;
        this.posY = posY;
        this.posZ = posZ;
        this.velX = velX;
        this.velY = velY;
        this.velZ = velZ;
    }
}
 

Rectangular Prism Class

Main.java

import java.util.Scanner;
 
public class Main {
    public static void main(String[] args) {
        // caleb b
        // Rectangular Prism
        Scanner scan = new Scanner(System.in);
        System.out.println("Enter the length of the rectangular prism: ");
        double length = scan.nextDouble();
        System.out.println("Enter the width of the rectangular prism: ");
        double width = scan.nextDouble();
        System.out.println("Enter the height of the rectangular prism: ");
        double height = scan.nextDouble();
        Prism prism = new Prism(length, width, height);
        System.out.println("The volume of the rectangular prism is " + prism.volume());
        System.out.println("The surface area of the rectangular prism is " + prism.surfaceArea());
    }
}

Prism.java

public class Prism {
    private double length;
    private double width;
    private double height;
 
    public Prism(double length, double width, double height) {
        this.length = length;
        this.width = width;
        this.height = height;
    }
 
    public double getLength() {
        return length;
    }
 
    public double getWidth() {
        return width;
    }
 
    public double getHeight() {
        return height;
    }
 
    public double volume() {
        return length * width * height;
    }
 
    public double surfaceArea() {
        return 2 * (length * width + length * height + width * height);
    }
}