For the code below, draw a picture of the program stack when the function findZero() is called the 2nd time.

COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
1st Edition
ISBN:9780357392676
Author:FREUND, Steven
Publisher:FREUND, Steven
Chapter6: Creating, Sorting, And Querying A Table
Section: Chapter Questions
Problem 10EYK
icon
Related questions
Question

For the code below, draw a picture of the program stack when the function findZero() is called the 2nd time.

 

VERYSMALL = 0.00000001
def findslope (а, b, с, х)
return 2*a*x + b
def findZero (a, b, с, х)
fn x %3D а*x*x + b * х + с
if abs (fn x) < VERYSMALL:
return X
findslope (а, b, с, х)
slope_x
next_guess = x - fn x/slope x
return findZero(a, b, c, next_guess)
%3D
# calling code
findZero (1, -2, 1, 5);
Transcribed Image Text:VERYSMALL = 0.00000001 def findslope (а, b, с, х) return 2*a*x + b def findZero (a, b, с, х) fn x %3D а*x*x + b * х + с if abs (fn x) < VERYSMALL: return X findslope (а, b, с, х) slope_x next_guess = x - fn x/slope x return findZero(a, b, c, next_guess) %3D # calling code findZero (1, -2, 1, 5);
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Stack
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L