Question: Question 5 For this section, many methods are given. They however contain errors. Some errors are syntax error while others are logical error. The main
Question
For this section, many methods are given. They however contain errors. Some errors are syntax error while others are logical error. The main method contains test that will execute the two other methods and verify if they work properly.
The method is Prime checks if the number received as an argument is a prime number. A prime number is a number bigger then that can only be divided by or itself.
The Fibonacci method takes a number as argument and returns the value at this position in the Fibonacci series. In the Fibonacci series, each number is the sum of the two preceding position in the series. The position has the value and the position has the value This table describes the series:
table
public class Q
test getFibonacci
test getFibonacci
test
test getFibonacci
boolean testFlagtrue;
for int ; test.length;
f test
System.out println test "passed";
else
System,out.printlntest failed";
testFlag false;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
