Question

write an algorithm by using java code to find the approximate roots of the function using...

write an algorithm by using java code to find the approximate roots of the function using the fixed-point method

0 0
Add a comment Improve this question Transcribed image text
Answer #1

First, Define a function F(P0) that takes in a single input. This function will return the value of the mathematical function.

Then, Define the Main function as follows:

INPUTS GIVEN:

P0 = Initial approximation

T = Tolerance

N = Number of iterations

OUTPUT:

P = approximate root of the function

ALGORITHM:

Step 1: Set i = 1.

Step 2: While i < N, Follow Steps 3 through 6.

Step 3: Set P = F(P0).

Step 4: IF (|P - P0| < T), THEN break and PRINT P (P is the final answer).

Step 5: Set i = i + 1.

Step 6: Set P0 = P.

Step 7: IF (i > N), THEN PRINT "Method Failed"

Add a comment
Know the answer?
Add Answer to:
write an algorithm by using java code to find the approximate roots of the function using...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT