Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program in Common Lisp consisting of two functions to solve a specific problem related to quadratic equations. ( 1 ) The first function,
Write a program in Common Lisp consisting of two functions to solve a specific problem related to quadratic equations. The first function, named quadratic, should compute the value of a quadratic equation given its coefficients and a value for x It takes four parameters: the coefficients of the equation axbxc and x the value at which to evaluate the equation This function should return the result of axbxc The second function, named greaterRoot, should determine the greater of the two roots of a quadratic equation given its coefficients. It accepts three parameter: abc The function should first check if the discriminant bac is nonnegative, which indicates the roots are real. If so it calculates both roots and returns the greater one. If the discriminant is negative, indicating that the roots are complex, the function should print a message stating that the equation has no real roots. After defining these functions, use them to find and print the greater root of the quadratic equation with coefficients a b and c ensuring your output matches the format "Greater root for a b c: root Then, evaluate the quadratic equation at this root using the quadratic function and print the result in the format frootvalue Ensure your program correctly handles the calculation and formatting of the output.
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