aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/example/BoxModel.java
diff options
context:
space:
mode:
authoralex <[email protected]>2026-10-23 08:49:26 +0200
committeralex <[email protected]>2026-10-23 08:49:26 +0200
commit7fc3f81546836be9d46c5d4616a5fea554a8b022 (patch)
tree4d51dde1f9337c40693ff10a81a182f5648fc62f /src/main/java/com/example/BoxModel.java
parentb6d4f305faa12ee361a695290d08c68818721ed6 (diff)
downloadjavafx-uloha-7fc3f81546836be9d46c5d4616a5fea554a8b022.tar.xz
javafx-uloha-7fc3f81546836be9d46c5d4616a5fea554a8b022.zip
aura
Diffstat (limited to 'src/main/java/com/example/BoxModel.java')
-rw-r--r--src/main/java/com/example/BoxModel.java48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/main/java/com/example/BoxModel.java b/src/main/java/com/example/BoxModel.java
new file mode 100644
index 0000000..0dd4e65
--- /dev/null
+++ b/src/main/java/com/example/BoxModel.java
@@ -0,0 +1,48 @@
+package com.example;
+
+public class BoxModel {
+ private double width;
+ private double height;
+ private double depth;
+
+ private double area;
+ private double volume;
+
+ public BoxModel(double width, double height, double depth) {
+ this.width = width;
+ this.height = height;
+ this.depth = depth;
+ }
+
+ public double getWidth() {
+ return width;
+ }
+
+ public void setWidth(double width) {
+ this.width = width;
+ }
+
+ public double getHeight() {
+ return height;
+ }
+
+ public void setHeight(double height) {
+ this.height = height;
+ }
+
+ public double getDepth() {
+ return depth;
+ }
+
+ public void setDepth(double depth) {
+ this.depth = depth;
+ }
+
+ public double getVolume(){
+ return this.width * this.height * this.depth;
+ }
+
+ public double getArea(){
+ return 2 * (this.width * this.height + this.width * this.depth + this.height * this.depth);
+ }
+}