Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write code in C++ Follow the Class below! Implement a polynomial class with a member data of a dynamic array. A.txt A=4x7+5x6+3x3+2x1+8x0 agree (7 Dynamic

Write code in C++
Follow the Class below!
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Implement a polynomial class with a member data of a dynamic array. A.txt A=4x7+5x6+3x3+2x1+8x0 agree (7 Dynamic arr B.txt B=6x8+3x6+4x5+8x3+3x1+2x0 (b) 8 "define MAX COUNT 100 class Polynomial \{ public: PolynomialO; /1 defautt constructor Polynomial(int* coef, int degree); Polynomial(const Polynomial\& poly); / copy constructor Molynomial); 1/ destructor I/ setters and getters void setDegree(int degree); yoid setcoef(intt coef, int degree)i int getDegree(); int* getcoef( ) Polynomial\& operator=(const Polynomial\& rightside); // operator = friend Polynomial operator +(const Polynomial\&, const Polynomial\&); friend Polynomial operator-(const Polynomial\&, const Polynomial\&); Il add print nember function if needed private: int* coef; /I dynamic array of coefficients int degree; /l degree of a polynomial A=4x7+5x6+3x3+2x1+8x0 Object A. \begin{tabular}{|l|l|l|l|l|l|l|l|} \hline 0 & 1 & 2 & 3 & 5 & 6 & 7 \\ \hline 8 & 2 & 0 & 3 & 0 & 0 & 5 & 4 \\ \hline \end{tabular} coef degree 7 B=6x8+3x6+4x5+8x3+3x1+2x0 S.PolynomialB>68+3x1a6+4x15+8x3+3x1+2x10in+B>6x48+4x7+8x6+4x5+11x3+5x11+10x70degreeA+B4B77+2x6+4x5+5x33+x41+6x0

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

More Books

Students also viewed these Databases questions

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago