Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2) parabola.py Recall that the graph of a quadratic equation :1; = (19:2 + In: + c, a 71- 0 is a parabola. The equation
2) parabola.py Recall that the graph of a quadratic equation :1; = (19:2 + In: + c, a 71- 0 is a parabola. The equation can be written in vertex form as y = 0(1: h) + k, where (h, k) is the vertex of the parabola. Create a class denition for a class called Parabola. The objects of this class have the following attributes: o ._xvert, representing the .r-coordinate of the vertex; 0 ._yvert, representing the ycoordinate of the vertex; 0 ._1eadingcoef, representing the leading coefcient (a) in the equation for the parabola; The class denition should also contain the following methods: 0 a constructor (that's another name for the . __init__() function), which takes 3 oats, which set the attribute variables in the order given above; 0 .yintercept O, which takes no outside arguments, and returns (NOT prints) the ycoordinate of the y-intercept of the parabola (recall you can nd the yintercept by setting 3: equal to zero in the equation for the parabola); a .display(), which takes no outside arguments and returns nothing, but prints out the attribute variables (just print out the attribute variables in one print statement, in the order shown above, and nothing else); 0 .isConcaveDownO which takes no outside arguments, and returns True if the parabola is concave down (that is, if a
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started