Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Your focus in this assignment will on the implementation of the Polynomial class in files polynomial.h and polynomial.cpp . This class stores the set of

Your focus in this assignment will on the implementation of the Polynomial class in files polynomial.h and polynomial.cpp. This class stores the set of coefficients that define a polynomial (e.g.,1+2x+4x^3).
Although the immediate use of Polynomial is in support of this polyfactor program, we anticipate the possibility that Polynomial may be reused in other future projects, so we want to make sure that it is designed and implemented to facilitate that reuse.
You must not change the private data members in polynomial.h.(You may, if you wish, add additional private function members if doing so would aid you in completing the implementation.)
You may need to change some of the public functions in polynomial.h, but keep in mind that the Polynomial class must continue to compile with the other code in this program.
Your code will be evaluated both on its ability to function correctly within the polyfactor application (the systems tests) and on its ability to pass the various unit tests provided.
Attached is polynomial.h #ifndef POLYNOMIAL_H
#define POLYNOMIAL_H
#include
#include
#include "term.h"
/**
This class implements a polynomial of the form
c0+ c1 x + c2 x^2+ c3 x^3+...
*/
class Polynomial {
public:
Polynomial();
Polynomial (int b, int a =0);
Polynomial (Term term);
Polynomial (int nCoeff, int coeff[]);
int getCoeff(int power) const;
int getDegree() const;
Polynomial operator+(const Polynomial& p) const;
Polynomial operator*(int scale) const;
Polynomial operator*(Term term) const;
void operator*=(int scale); Polynomial operator/(const Polynomial& p) const;
private:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions

Question

Explain how account analysis is used to estimate costs.

Answered: 1 week ago

Question

Explain all drawbacks of application procedure.

Answered: 1 week ago

Question

Describe some common hazards in the contemporary workplace

Answered: 1 week ago