### Category -> Java

### Write a method that accepts an int parameter and recursively calculates the sum of the numbers from 1 to the parameter.

Posted January 7, 2020

Tags:

The Problem: The sum of the numbers from 1 to n can be defined recursively as follows: The sum from 1 to 1 is 1. The sum from 1 to n is n more than the sum from 1 to n-1. Write a int-method named sum that accepts an int parameter, n, and recursively calculates and .... Read More

### Write a method that takes a single int parameter and returns that element of the Fibonacci series.

Posted December 3, 2019

Tags: , Recursion

The following Java coding solution is the first in a series of solutions for common recursion programming problems. It is perhaps not the best solution, and certainly not the only solution. If youâ€™ve got a better idea, please share. Problem: The Fibonacci series: 0, 1, 1, 2, 3, 5, 8, 13, 21, has as its first 2 values, 0 and 1; each successive v .... Read More

### Method that recursively calculates the factorial value

Posted December 2, 2019

Tags: , Recursion

The following Java coding solution is the first in a series of solutions for common recursion programming problems. It is perhaps not the best solution, and certainly not the only solution. If you've got a better idea, please share. Problem: Write a method called fact that recursively calculates the factorial value of its single int parameter. The value returned by fact is a long. .... Read More

### Word game solution in Java

Posted November 4, 2019

Tags:

Programming a word game is a common early challenge in most programming instruction. Here's a word game along with a solution which reads in content and produces output. There are many ways to tackle this problem, so feel free to share your thoughts. Word Game: Write a program that plays a word game with the user. The program should ask the user to enter the following: .... Read More