Guest User

Untitled

a guest
Jul 16th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. package com.yahoo.hlctt.main;
  2.  
  3. import java.util.Random;
  4.  
  5. public class Box {
  6. private float length;
  7. private float width;
  8. private float height;
  9. private float volume;
  10.  
  11. private final int SELF_WEIGHT;
  12. private final int MAX_WEIGHT;
  13. private int cargoWeight;
  14.  
  15. public Box() {
  16. length = 5.93f;
  17. width = 2.33f;
  18. height = 2.38f;
  19. volume = length * width * height;
  20. SELF_WEIGHT = 2_000;
  21. MAX_WEIGHT = 24_000;
  22.  
  23. Random rn = new Random();
  24. cargoWeight = rn.nextInt(MAX_WEIGHT - SELF_WEIGHT);
  25. }
  26.  
  27. public int getSELF_WEIGHT() {
  28. return SELF_WEIGHT;
  29. }
  30.  
  31. public int getCargoWeight() {
  32. return cargoWeight;
  33. }
  34.  
  35. }
Add Comment
Please, Sign In to add comment