Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Scheme help. been stuck on this for about a week 6. Remember the Quadratic formula, which can be used to find the roots of a
Scheme help. been stuck on this for about a week
6. Remember the Quadratic formula, which can be used to find the roots of a quadratic eguation? For a quadratic equation ax + bx+c=0.2 #0, the formula is Fb :v -- Tc 24 Notice that this gives us two different roots (because of the +) whenever b2 - 4ac70. Write the following SCHEME functions. (a) (root1 a b c) that gives us the root corresponding to the plus in the in the quadratic formula (that is calculate - --). (b) (root2 a b c) that gives us the root corresponding to the minus in the in the quadratic for mula (that is, calculate -- - (number-of-roots a b c) which calculates the number of distinct roots to the equation ax + bx+c=0,4 +0 (which will either be 1 or 2). (d) real-roots? a b c) is a boolean function that evaluates to #t when the roots of ax'+bx+ c=0,2 0 are real numbers. Note that you do not have to calculate the roots to determine whether they are real or complex numbers. Note: there are some common calculations done in the above functions: it may make sense to write some auxiliary functions to make your code simpler. 6. Remember the Quadratic formula, which can be used to find the roots of a quadratic eguation? For a quadratic equation ax + bx+c=0.2 #0, the formula is Fb :v -- Tc 24 Notice that this gives us two different roots (because of the +) whenever b2 - 4ac70. Write the following SCHEME functions. (a) (root1 a b c) that gives us the root corresponding to the plus in the in the quadratic formula (that is calculate - --). (b) (root2 a b c) that gives us the root corresponding to the minus in the in the quadratic for mula (that is, calculate -- - (number-of-roots a b c) which calculates the number of distinct roots to the equation ax + bx+c=0,4 +0 (which will either be 1 or 2). (d) real-roots? a b c) is a boolean function that evaluates to #t when the roots of ax'+bx+ c=0,2 0 are real numbers. Note that you do not have to calculate the roots to determine whether they are real or complex numbers. Note: there are some common calculations done in the above functions: it may make sense to write some auxiliary functions to make your code simpler
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started