Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A root is a value of x that make the equation equal to zero. You probably rememb

ID: 3673215 • Letter: A

Question

A root is a value of x that make the equation equal to zero. You probably remember from your early years, that the quadratic formula can tell you the roots of the equation. But for this lab, you will write an algorithm that allows the computer to find the root using a guess and check method. You code cannot use any intrinsic functions except for the function that generates a random integer number (from -100 to 100) to guess the root. Your code needs to use a while loop and should count how many guesses it took to get the right answer.

Thanks for any and all help.

Explanation / Answer

count = count + 1

  guess = (b-a).*rand(1,1) + a;
end

  

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote