Dhanu P.

asked • 11/30/22

11.10 LAB: Quadratic formula

Implement the quadratic_formula() function. The function takes 3 arguments, a, b, and c, and computes the two results of the quadratic formula

The quadratic_formula() function returns the tuple (x1, x2). Ex: When a = 1, b = -5, and c = 6, quadratic_formula() returns (3, 2).

Code provided in main.py reads a single input line containing values for a, b, and c, separated by spaces. Each input is converted to a float and passed to the quadratic_formula() function.

Ex: If the input is:

2 -3 -77

the output is:

Solutions to 2x^2 + -3x + -77 = 0
x1 = 7
x2 = -5.50


1 Expert Answer

By:

Alvin Z. answered • 01/22/23

Tutor
5 (2)

Undergrad in ECE & Robotics with TA experience

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.