Question: a function called find_roots that takes three numbers (????, ????, and????)andfindtherootsofthequadratic equationintheform???????? 2 + ???????? + ???? = 0 Forexample: Input->a=2,b=10,c=8 Output->(Thefirstrootis:1,Thesecondrootis:4) Youralgorithmshouldhavethefollowings:

a function called "find_roots" that takes three numbers (????, ????, and ????) and find the roots of the quadratic equation in the form ????????2 + ???????? + ???? = 0

For example:

Input -> a=2, b=10, c=8

Output -> ("The first root is: " −1, "The second root is: " −4)

 

 

Your algorithmshould have the followings:

  • [2 Marks]Take three inputs from the user (????, ???? and ????)
  • [3 Marks] A functionto find the roots called"find_roots"
  • [10 Marks] Calculate a variable called "delta" inside the function with the following formula:????2 − 4????????


 

  • [10 Marks]Find two roots using the formula: ????


 

 

= −????+√delta and????    =


 

 

−????−√delta 2????


 

1                    2????                            2


 

(Hint: for square root use ????????????ℎ.????????????????(????????????????????????????????????????))

  • [5 Marks]Returns a tuple with the following elements:

("The first root is: " 1>, "The second root is: " 2>)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer Heres a Python function named findroots that implements the algorithm you described impor... 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 Programming Questions!