Question: In your first programming project you created a java file called Quadratic.java, which took the Coefficients of a quadratic equation and gave the two solutions

In your first programming project you created a java file called Quadratic.java, which took the Coefficients of a quadratic equation and gave the two solutions for the variable X. At the time we assumed the user would give us three values that would successfully work. However if the user gave us a zero for the A term or a set of values that caused ( B2-4AC ) to be non-positive, we would end up not getting two rational solutions. Your job is to add the code required to throw exceptions if either of these above conditions happen. Put try and catch blocks in your code in a way that will force the user to enter the values again if they are not good ones.

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!