Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
image text in transcribed

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

Recommended Textbook for

QuickBooks A Beginners Guide For Bookkeeping And Accounting For Small Businesses

Authors: Adam J. Belfort

1st Edition

8615413703, 979-8615413704

Students also viewed these Databases questions