Call your class quadraticExpression. • Your private data will be a, b, c. Make them doubles. • Create an enumerated list with o NO_ROOTS = 0 o ONE_ROOT = 1 o TWO_ROOTS = 2 o INFINITE_ROOTS = 3 • Write the constructor as stated in the book • Write the changeCoeeficients as stated in the book • Write the getACoeeficient, getBCoeeficient, getCCoeeficient as inline constant functions • Write evaluate function to take a double a return a double. Constant function. • Write getNumberOfRoots function to return an integer. Constant function. • Write getFirstRoot and getSecondRoot to return the first and second roots. Return a domain_error is there is no first or second root. Constant Functions. Use my .cpp file to test out your class.
Call your class quadraticExpression.
• Your private data will be a, b, c. Make them doubles.
• Create an enumerated list with
o NO_ROOTS = 0
o ONE_ROOT = 1
o TWO_ROOTS = 2
o INFINITE_ROOTS = 3
• Write the constructor as stated in the book
• Write the changeCoeeficients as stated in the book
• Write the getACoeeficient, getBCoeeficient,
getCCoeeficient as inline constant functions
• Write evaluate function to take a double a return a double. Constant
function.
• Write getNumberOfRoots function to return an integer. Constant
function.
• Write getFirstRoot and getSecondRoot to return the first and second
roots. Return a domain_error is there is no first or second root.
Constant Functions.
Use my .cpp file to test out your class.
Step by step
Solved in 4 steps with 2 images