This is where it gets a little fantastic. Suppose you had a modern computer to help you do the computation. Write a program that will compute the number of stone blocks in a pyramid.
The pyramid has a square base. Each block of stone is shaped like a cube. The pyramid is built by laying down a square array of blocks, and then laying down a smaller square of stones on top of the one just laid down. The process is repeated until a single stone is laid for the top course.
Take a rather small pyramid as an example. The first course might be four stones square. It would require four squared (16) stones to complete the first course. The second course will be three square (nine stones). The third course will be two square (four stones). the fourth and last course will be the final single stone. To obtain the total number of stones in the pyramid, add the number of stones in all the courses (16 + 9 + 4 + 1 = 30).
Write a recursive function that takes the height of the pyramid (number of courses) and returns the total number of stones in the pyramid. The user interface should request the input number and print the output to the screen.
For your report for this assignment, you should describe your approach to the design of the program (or algorithm), give sample outputs for heights of 5, 10, 20, 30, and 50, and include your commented source code with programmer's block.