Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.yahoo.hlctt.main;
- import java.util.Random;
- public class Box {
- private float length;
- private float width;
- private float height;
- private float volume;
- private final int SELF_WEIGHT;
- private final int MAX_WEIGHT;
- private int cargoWeight;
- public Box() {
- length = 5.93f;
- width = 2.33f;
- height = 2.38f;
- volume = length * width * height;
- SELF_WEIGHT = 2_000;
- MAX_WEIGHT = 24_000;
- Random rn = new Random();
- cargoWeight = rn.nextInt(MAX_WEIGHT - SELF_WEIGHT);
- }
- public int getSELF_WEIGHT() {
- return SELF_WEIGHT;
- }
- public int getCargoWeight() {
- return cargoWeight;
- }
- }
Add Comment
Please, Sign In to add comment