For this problem you will write a method that computes the number of boxes in a pyramid of boxes based on the number of boxes in the base. The boxes in each layer of the pyramid are stacked directly on top of one another (i.e. not offset between two boxes below). For example, below are shown two pyramids, one with base 5 and one with base 6. [] [][] [][][] [][][][] [][][][][] [][][][][][] Implement and test the computePyramidBoxes() method in the PyramidBoxCount class. When testing the computePyramidBoxes() method you should be sure to have at least one test method for each base case and at least one test method for each recursive case in your program.
For this problem you will write a method that computes the number of boxes in a pyramid of boxes based on the number of boxes in the base. The boxes in each layer of the pyramid are stacked directly on top of one another (i.e. not offset between two boxes below). For example, below are shown two pyramids, one with base 5 and one with base 6.
[] [][]
[][][] [][][][]
[][][][][] [][][][][][]
Implement and test the computePyramidBoxes() method in the PyramidBoxCount class. When testing the computePyramidBoxes() method you should be sure to have at least one test method for each base case and at least one test method for each recursive case in your
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images