Question: Create a user-defined function that will solve for the largest real root of the equation ax 2 + bx + c = 0 If no

Create a user-defined function that will solve for the largest real root of the equation

ax2 + bx + c = 0

Create a user-defined function that will solve for the largest real root

If no real roots (real roots exist only when b2 - 4ac 0), then display an error message.

Your function should take three numbers as input (a, b, and c) and return the largest real solution. Test your function with these three cases:

a = 1, b = 3, and c = 2 (roots = 1 and 2)

a = 1, b = 1, and c = 1 (roots = (1 sqrt(3))/2 --> non-real)

a = 1, b = 1, and c = 1 (roots = (1 sqrt(5))/2 = -0.618 and 1.618)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!