CourseWare Wiki
Switch Term
Winter 2023 / 2024
Winter 2022 / 2023
Winter 2021 / 2022
Winter 2020 / 2021
Winter 2019 / 2020
Winter 2018 / 2019
Older
Search
Log In
old
courses
be5b33prg
homeworks
quadratic_equation
Warning
This page is located in archive. Go to the latest version of this
course pages
.
Differences
This shows you the differences between two versions of the page.
View differences:
Side by Side
Inline
Go
Link to this comparison view
2016/11/04 16:03 xposik
2016/10/27 12:42 xposik [Quadratic equation solver]
2016/10/27 12:42 xposik [Quadratic equation solver]
2015/10/02 17:49 svobodat
2015/10/02 17:29 svobodat created
Go
Next revision
Previous revision
2016/11/04 16:03 xposik
2016/10/27 12:42 xposik [Quadratic equation solver]
2016/10/27 12:42 xposik [Quadratic equation solver]
2015/10/02 17:49 svobodat
2015/10/02 17:29 svobodat created
Go
Next revision
Both sides next revision
courses:be5b33prg:homeworks:quadratic_equation [2015/10/02 17:29]
svobodat
created
courses:be5b33prg:homeworks:quadratic_equation [2016/10/27 12:42]
xposik
[Quadratic equation solver]
Line 2:
Line 2:
Create a text file ''quadeq.py''. In it, define function ''get_roots(a, b, c)'' which
Create a text file ''quadeq.py''. In it, define function ''get_roots(a, b, c)'' which
-
* accepts the coefficients of a quadratic equation $ax^2 + bx + c = 0$, and
+
* accepts the coefficients
$a$, $b$, and $c$
of a quadratic equation $ax^2 + bx + c = 0$, and
* returns a list of its real roots, i.e. the function returns
* returns a list of its real roots, i.e. the function returns
* a list with 2 numbers when the equation has 2 real roots,
* a list with 2 numbers when the equation has 2 real roots,
Line 8:
Line 8:
* an empty list when the equation has no real roots.
* an empty list when the equation has no real roots.
Assume that ''a'' is always nonzero.
Assume that ''a'' is always nonzero.
+
+
===== Grading: =====
+
* 3 points for automatic checks
+
* 1 point for manual evaluation (is the code readable)
+
+
courses/be5b33prg/homeworks/quadratic_equation.txt
· Last modified: 2016/11/04 16:03 by
xposik