Question: MUST BE IN C++. ALSO PLEASE LABEL EACH TASK (1,2,3). THANKS :))))))) Write a function, quadEquation() which takes five arguments, each of type double. The

 MUST BE IN C++. ALSO PLEASE LABEL EACH TASK (1,2,3). THANKS

MUST BE IN C++. ALSO PLEASE LABEL EACH TASK (1,2,3). THANKS :)))))))

Write a function, quadEquation() which takes five arguments, each of type double. The first three parameters: a, b, and c, represent the coefficients in the equation ax^2 + bx + c = 0. The last two parameters, rl 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 plusmn 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!