Question: 2. Write a program that determines the number of real/complex roots and the values of the roots for the quadratic equation y=ax2+bx+c When the program
2. Write a program that determines the number of real/complex roots and the values of the roots for the quadratic equation y=ax2+bx+c When the program runs, it asks the user to enter the values of the constants a,b, and c. This can be done by asking the user for multiple inputs or asking the user to enter a vector of the coefficients. To calculate the roots of the equation the program calculates the discriminant D, given by D=b24ac - If D>0, the program displays the message "The equation has two real roots" and the roots are displayed on the next line. - If D=0, the program displays the message "The equation has one real root" and the root is displayed on the next line. - If D
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
