February 2014
Beginner
1248 pages
62h 25m
English
Method startFibonacci (lines 59–70) is called several times in main (lines 29, 30, 39 and 41) to initiate Fibonacci calculations and to calculate the time each calculation requires. The method receives the Fibonacci number to calculate and performs the following tasks:
• Line 62 creates a TimeData object to store the calculation’s start and end times.
• Line 64 displays the Fibonacci number to be calculated.
• Line 65 stores the current time before method fibonacci is called.
• Line 66 calls method fibonacci to perform the calculation.
• Line 67 stores the current time after the call to fibonacci completes.
• Line 68 displays the result and the total time required for the ...
Read now
Unlock full access