Methods2024 NHT Exam 2 Section A · Q14CAS active1 mark
Pseudocode search for intersection of y = x and y = cos(x)
Parts of the graphs of two functions, and , are shown below, where is measured in radians.
The pseudocode below describes a simple algorithm to find the point where the two functions intersect.
define intersect(x0, x1):
x ← x0
while x < x1
if -0.01 < cos(x) - x < 0.01 then
return x
end if
x ← x + 0.01
end while
return "No intersection found"
Which of the following will the function intersect(0.6, 0.8) return?
Hints, answer checking and worked solutions come with a Season Pass.
