Write a method to compute the sum of the cubes of the first n natural numbers using loops and conditionals.
The sum of the cubes of the first n natural numbers is the result of adding the cubes of all numbers from 1 to n. For example, the sum of the cubes of the first 3 natural numbers (1^3 + 2^3 + 3^3) is 36.
- The method should not use any formula for the sum of cubes.
- The method should handle large values of n efficiently.
sumOfCubes(3); // returns 36