HOME | Overview | Syllabus | Instructor | Lectures | Laboratories | Readings | Assignments | Resources | Other Links
CS 1713 Lecture 16: More Design
October 6, 1999
In this lecture we will design a class to represent a quadratic polynomial of the form:
           2 
        a x   + b x  + c
The coefficients a, b and c are real numbers. Among the information the class will be expected to provide are the values of its coefficients, the values of its roots (real values only), the number of real roots, the value of x at its extreme point, and the value of the polynomial at its extreme point.

Notes about quadratics: the roots (zeroes) are given by the quadratic formula:

                        2
        -b  +/-  sqrt( b  - 4 a c)
         -------------------------
                    2 a
The extreme value is at
         x =    -b
               ---- 
                2a 

Part I: Design and test a Quadratic class that handles real roots.

Part II: Generalize the Quadratic class to allow complex roots.


Objective: Gain more experience with designing classes
Last revision: October 5, 1999 at 11:50 am