Question: Write a method called quadratic that solves quadratic equations and prints their roots. Recall that a quadratic equation is a polynomial equation in terms of

Write a method called quadratic that solves quadratic equations and prints their roots. Recall that a quadratic equation is a polynomial equation in terms of a variable of the form ax2 + bx + c = 0. The formula for solving a quadratic equation is

ー6土V - 4ac 2a ||

Here are some example equations and their roots:

x2 − 7x + 12 : x = 4, x = 3

x − 3x + 2 : x = −2, x = −1

Your method should accept the coefficients a, b, and c as parameters and should print the roots of the equation. You may assume that the equation has two real roots, though mathematically this is not always the case.

6V - 4ac 2a ||

Step by Step Solution

3.33 Rating (186 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

public static void quadratic int a int b int c d... View full answer

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 Building Java Programs A Back to Basics Approach Questions!