Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN C PROGRAMMING PLEASE AND THANK YOU Program: Roots of a second-order polynomial (Branches) Program Specifications. Develop a program using the Eclipse or Visual Studio

image text in transcribedimage text in transcribed

image text in transcribedIN C PROGRAMMING PLEASE AND THANK YOU

Program: Roots of a second-order polynomial (Branches) Program Specifications. Develop a program using the Eclipse or Visual Studio Code IDE to calculate the roots of a second-order polynomial. A second-order polynomial is of the form ax2+bx+c=0. Your program should read in real (i.e., floating point) values for coefficients a,b, and c then compute and print the roots. Recall that the roots are real or complex values of x that satisfy the polynomial. Different cases 1. If both a=0 and b=0, the polynomial is considered degenerate. In this case, display the message "Polynomial is degenerate." 2. If a=0 but b=0, the polynomial has one root x=bc. In this case, display the message "Polynomial has one real root x= " followed by the numeric root value. 3. If a=0, the polynomial has two roots, x1,2=2a1(bb24ac). Recall from algebra, if the discriminant b24ac=0 the two roots are real (e.g., not complex numbers) and equal. In this case, display the message "Polynomial has two real and equal roots = " followed by the numeric root value. On the other hand, if the discriminant b24ac0 the two roots are both real. In this case, display the message "Polynomial has two real roots = " followed by the two root values. Examples If the input is: 123 your output should be: Polynomial has two complex roots =1.000000+i1.414214 and 1.00000011.414214 If the input is: 156 your output should be: Polynomial has two real roots =2.000000 and 3.000000 If the input is: 121 your output should be: Polynomial has two real and equal roots =1.000000 If the input is: 023 your output should be: Polynomial has one real root x=1.500000 OneDrive - San Diego State University (SDSU.EDU) - QuadraticFormula/src/QuadraticFormula.c - Eclipse IDE File Edit Source Refactor Navigate Search Project Run Window Help Q Run QuadraticFormula.exe Q [c) QuadraticFormula.c Project Explorer x 1/ \#include stdio. int main(void) \{ printf (1)i return 0; Problems Tasks Console Properties CDT Build Console [QuadraticFormula] "make all" terminated with exit code 2. Build might be incomplete. 17:13:12 Build Failed. 2 errors, 0 warnings. (took 2s.726ms)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions