Question: C++ programming If statements are simple but essential control statements. Begin this lab by creating a new solution and/or project and copying and pasting the
If statements are simple but essential control statements. Begin this lab by creating a new solution and/or project and copying and pasting the code for lab 1, program 1 into the new project. Name the new source code file Reasoning Behind the Requirements The quadratic formula: x1 = -b + squareroot b^2 - 4ac/2a and x2 = -b - squareroot b^2 - 4ac/2a fails if coefficient a is 0: the other coefficients (b and c) may be 0 without causing harm. II. The discriminant, b^2 - 4ac, determines the kinds of roots that a quadratic equation has if the discriminant is greater than or equal to 0, the equation has two real roots else if the discriminant is less than 0, the equations has two complex roots III. Complex numbers are displayed as two separate numbers (a real part and an imaginary part) with character decorations added to help separate and distinguish the two numbers. For example, 6 + 3i and 6 - 3i. i. The '+', '-', and 'i' are just character constants ii. The real part (6 in the example) is calculated by the formula -b/2a iii. The imaginary part (3i in the example) is calculated by the formula squareroot (-discriminant)/2a iv. Assume two variables named real and imag, then the output could be written as: cout 0 b. Add code for lab 2 to handle the case when the discriminant is
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
