Develop a Java program to set up a linked list of nodes, where each node will have 2 fields:

a field to hold a subexpression (ex. 1.0/2)
a field to point to the next field

The program will then recursively compute and then report the following summation:

1.0/2 + 1.0/4 + 1.0/6 + ... + 1.0/n

where n >= 2.

Your application is to consist of multiple methods, including the following:

A value-returning method to return a valid value for n
Have the user enter a value for n, a positive integer.
Use exception handling to handle non-positive integers
Once a valid value for n is entered, return it to the calling method
A value-returning method to recursively compute the summation
Return the computed value to the calling method
A void method that receives copies of n and the summation value and displays them, along with appropriate messages
A main() method, where the above methods are called



Answer :

Other Questions