Write a Java program that solves a set of quadratic equations asper Requirement #1 (without using global variables), and reads aninteger number entered in the command line, as follows: > javaprogram_name input_number and depending on the value of this numberdoes the following:
1) If the number entered is positive, the program shall solve(running in a loop) as many quadratic equations of the followingform, as the input_number tells:
a * x2 + b * x + c = 0
where coefficients a, b and c are double values, entered fromthe keyboard as per Requirement #3.
2) If the input number entered in the command line is notpositive, the program shall print the following message to thescreen and exit:
A positive value shall be entered in the command line.
3) The values of coefficients a, b and c, as listed inRequirement #1, shall be read from the keyboard by the program withthe following message on the screen, each time a new coefficient isneeded:
Please enter the next coefficient of a quadratic equation:
4) If the coefficient a is a zero, the program shall display thefollowing message on the screen (first line) repeating the requestfor another value of a (second line):
Coefficient a cannot be a zero. Enter the correct value. Pleaseenter the next coefficient of a quadratic equation:
5) When the program solves the quadratic equation (calculatesthe roots), as per Requirement #1, the following output shall bedisplayed on the screen:
Quadratic equation with the following coefficients
a: ; b: ; c: has
the following roots: and
6) In case the quadratic equation for given coefficients doesnot have roots, the program shall print the following message, andcontinue operation for the next set of coefficients:
Quadratic equation with the following coefficients:
a: ; b: ; c: does nothave roots