Before attending this lab you should have read and be famili
Before attending this lab, you should have read and be familiar with Chapter 3 sections 3.1, 3.2, and 3.3 of Delores Etter\'s Engineering Problem Solving with C. Write a conditional expression that returns a value of true if the absolute values of the variables \"A\" and \"B\" are both less than 0.0001. Write a conditional expression that returns a value of true if the absolute value of \"A\" is less than 0.0001, but the absolute value of \"B\" is greater than that threshold. Write a conditional expression that returns a value of true if the quantity B^2-4AC is less than zero Write an if/else statement that prints an error message in the case where the condition from 1) is true Write an assignment statement that calculates the result of the quadratic equation and puts one of the two possible solutions in a variable called x1. B^2-4AC is known as the discriminant of the quadratic equation. Assuming that the discriminant is negative, write an expression in terms of A, B, and C that describes the complex solutions of the quadratic equation. This expression should be in the form of: x = (real part) plusminus i*(imaginary part)
Solution
1.
if(abs(a) <0.0001 && abs(b)<0.0001)
return true;
2.
if(abs(a) <0.0001 && abs(b)>0.0001)
return true;
3.
if((B*B - 4*A*C) < 0)
return true;
4.
if(abs(a) <0.0001 && abs(b)<0.0001)
printf(\"Error condition\");
5.
x1 = (-B +sqrt(B*B - 4*A*C))/(2*A);
6.
x = -B/(2*A) + i*(sqrt ( -(B*B - 4*A*C) ) ) / (2*A);
