ECE 231 – Fall 2010
Programming Assignment 6
Due: Tuesday, October 26, 2010 at 11:59 PM
For this assignment, you will be creating a
quad
class that contains the variables a, b, and c.
The
quad
class represents a quadratic equation of the form
c
bx
ax
+
+
2
.
This class will contain a
mix of constructors, member functions, overloaded operators and friend functions.
Create the following data items and class functions:
1.
Your data members are a, b and c which are the coefficients of the quadratic equation.
2.
You will have three constructors: one with no arguments that default the coefficients to
0.0; one with a single argument that assigns all coefficients to the same value; and, one
with three arguments in the order of a, b and c coefficients.
3.
A
solve()
function that has no arguments and solves the quadratic equation by finding its
roots (these roots can be two different values, one single value or two complex values).
This function prints the result and does not return a value.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '08
 Peralta,S
 relational operator, Programming constructs, quad, [email protected]

Click to edit the document details