Question: asap please In this exercise, you're required to define a class Box. It has: - Attributes: width, length and height (all int type) - A
In this exercise, you're required to define a class Box. It has: - Attributes: width, length and height (all int type) - A function void init(int w, int l, int h ) that initializes width, length and height attributes of box. - A void print() method that prints the volume of box. It also prints whether it's a cube or cuboid. If all the sides are same, it prints it's a cube, otherwise it's a cuboid. The main function is already given, as you define the Box class, the main should function accordingly. Sample run: Enter box dimensions: 546 The volume of box: 120 It's a Cuboid 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
