Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

**** NEEDS TO BE IN C++ ******** Implement and test a preliminary version of the polynomial class , using a small array to store the

****NEEDS TO BE IN C++ ********

Implement and test a preliminary version of the polynomial class, using a small array to store the coefficients of the polynomial in order of increasing exponents, following the design pattern of object-oriented approach. Suppose the range of the exponents is in [0, 30).

Use an array as a private member variable.

insert(), adding a new term on specific exponent.

remove(), deleting a term.

Have a add() method, deciding the parameters and the return value by yourself.

Have a sub() method, deciding the parameters and the return value by yourself.

A printout() method to display the polynomial expression.

And other variables, or methods if needed.

Do the algorithm analysis on the implemented method, and give the big O notation estimation.

You will also need to write a PolynomialTest program to initialize two linear polynomial objects and apply the operation on it and also display the result. For example, P1=x + 3x5 - 5x8; P2= 2x3 - 4x5+ 2x7; So P3= P1+P2= x +2x3 - x5+ 2x7 - 5x8, P4 = P1-P2 = x - 2x3 + 7x5- 2x7 - 5x8.

In this project, only one variable is considered, we dont have the polynomial such as x+3x5 3y3 .

*****Need to provide:

problem statement, analysis of ALGORITHM COMPLEXITY, algorithm design, program Input/Output, and tested result (analysis your result).

Copy able code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions