Question: Marks ] Write a function quadratic which has three parameters: a , b and c . These are values in the standard quadratic equation: a

Marks] Write a function quadratic which has three parameters: a,b and c. These are values in the standard quadratic equation:
ax2+bx+c=0
e function will return a string containing the value for x as follows:
det=b2-4ac
When det is equal to zero, x is calculated as follows:
x=-b2a
return a string containing this value to 2 decimal places. Example:
x=4.56
When det is greater than zero, x is calculated as:
x1=-b+det22a
x2=-b-det22a
return a string containing these values to 2 decimal places. Example:
x=3.57 and -4.56
When det is less than zero, x is calculated as:
x Real =-b2a
x Imaginary =-det22a
return a string containing these values to 2 decimal places. Example:
x=3.56-2.34i and 3.56+2.34i
 Marks] Write a function quadratic which has three parameters: a,b and

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To solve this problem youll want to write a function that computes the roots of a quadratic equation ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!