Design and implement a class called Box that contains instance data that represents the height, width, and depth of the box.

Design and implement a class called Box that contains instance data that represents the height, width, and depth of the box.

LANGUAGE: Java

CHALLENGE:

Design and implement a class called Box that contains instance data that represents the height, width, and depth of the box.
These dimensions should be of a type that can represent linear measurements, including fractional ones.
Also include a boolean variable called full as instance data that represents whether the box is full or not.

Define the Box constructor to accept and initialize the height, width, and depth of the box.
Each newly created Box is empty (the constructor should initialize full to false).
Include getter and setter methods for all instance data.
Include a toString method that returns a one-line description of the box of the form “HxWxD” where H, W, and D are the current values respectively of the boxes height, width and depth.

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days – Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level