Question: Write a program that will solve any quadratic function with real roots using the quadratic formula: Ax 2 + Bx + C = 0, root1=

  1. Write a program that will solve any quadratic function with real roots using the quadratic formula:

Ax2 + Bx + C = 0, root1= (-B-sqrt(B*B 4*A*C))/(2*A), root2 = (-B+sqrt(B*B 4*A*C))/(2*A)

The user will be allowed to solve as many quadratic equations as possible. Use a while loop menu; the user is prompted to enter A, B, C until the user is ready to quit. Note the following:

  1. A!=0. If this is violated, display Ax2 + Bx + C = 0, is not quadratic
  2. B*B-4*A*C>=0. If this is violated, display Ax2 + Bx + C = 0, does not have real roots

If the two conditions are satisfied, calculate and display the roots.

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!