Question: IT MUST BE IN C++. THANKS :)))) Write a function quadEquation () which takes five arguments, each of type double. The first three parameters a,

 IT MUST BE IN C++. THANKS :)))) Write a function quadEquation

IT MUST BE IN C++. THANKS :))))

Write a function quadEquation () which takes five arguments, each of type double. The first three parameters a, b, and c, represents the coefficients in the equation ax^2 + bx + c = 0. The last two parameters, r1 and r2, are passed by reference. They are the roots (solutions) to the quadratic equation. Recall that the quadratic equation is as follows, where r represents roots (solutions): r = -b plusminus Squareroot b^2 - 4ac/2a You must create appropriate exception classes for the following: Divide by zero Square root of negative number Only one (repeated) root Write specifications for the above function in comments. Write these comments above the function definition and make sure to include: Pre-conditions Post-conditions The exceptions that could be thrown, and what they mean Write a main function that calls the quadEquation() function with a try statement. You should also write a corresponding catch statement for the aforementioned exceptions and print out an appropriate response

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!