Short C++ script

Befejezett Kiadva: Feb 9, 2015 Kiszállításkor fizetve
Befejezett Kiszállításkor fizetve

Hi, I need this problem to be solved in the next few hours:

Problem Description

Your task is to design and develop a C++ class whose objects represent polynomials.

A polynomial is shown as:

anxn + an-1xn-1 + … + a0

To simplify things, you can safely assume that the power of x and the coefficients are all integers.

Your Polynomial class should provide at least the following methods:

A default contructor, that produces a polynomial that has only a constant term of 0.

A constructor with a single argument of type int, that produces the polynomial that has only one constant term that is equal to the constructor argument.

A constructor with three arguments, two int arrays and an int typed size. The first array stores exponents of the terms and the second array stores the coefficients of the corresponding terms.

A copy constructor.

A suitable destructor.

A method to evaluate the polynomial. This method has one argument of type int, and returns the value obtained by plugging in its argument for x and performing the indicated operations.

Overload the operators +, -, and * for addition, subtraction, and multiplication of polynomials.

As friend functions, overload input operator and output operator to input and output polynomials.

When the user inputs a polynomial, the user types in a list of integer pairs. In each pair, the first is the exponent of the term and the second is the coefficient of the term. A pair starts with 0 (meaning constant term) indicates the end of the input for this polynomial. For example, the polynomial

x7 + 3x4 - 5x3 + 2

will be entered by a user as:

7 1

4 3

3 -5

0 2

and the output should be shown as:

x^7 + 3x^4 - 5x^3 + 2

And as another example, the polynomial

2x4 + x3 - x2

will be entered by a user as:

4 2

3 1

2 -1

0 0

and the output should be shown as:

2x^4 + x^3 - x^2

For a sample main function to test the Polynomial class, click here. You need to include your own main function to test your Polynomial class.

Design and Documentation

You need to make and document decisions about which concrete data structure(s) to use for your Polynomial class implementation.

You need to develop a README file as a way of design documentation. In your README file (Note: do not give it any extension name), there should be following sections:

Overview: briefly describe the requirement of this program, especially of the class Polynomial.

Design: briefly describe the modules in your design and why you choose your current design.

Implementation: briefly describe the concrete data structures used in each module. List the advantage and disadvantage of using these data structures. Explain whether there are alternative ways to implement this program.

Accomplishment: state clearly which parts of the assignment you completed.

Testing: list the test cases you have covered to test your program. For each test case, describe the data you used and the result shown by your program. Alternatively, if you used script to capture the sample run of your program, then you only need to describe your test cases and refer to your typescript file for the test run result.

Know Bugs.

Note: anything you would like to draw to the attention of the marker.

Your source code file(s) should have the usual documentation as mentioned in the first assignment.

Create a Makefile to automate the building of your program. Upon typing make, an executable file named pex2 should be generated.

C++ Programozás

Projektazonosító: #7114963

A projektről

3 ajánlat Távolról teljesíthető projekt Utoljára aktív: Feb 9, 2015

Odaítélve:

crazynightwalker

Hi. I can build your polynomial class with the specified requirements in the next few hours. I have 10 years of experience with C++.

$25 CAD 1 napon belül
(19 értékelés)
4.7

3 szabadúszó tett átlagosan 25$ összegű árajánlatot erre a munkára

dobreiiita

Hello I am c++ expert and interested in this project. I have reviewed the details and confident to handle this project perfectly. Please communicate to discuss further. Regards Anshu

$30 CAD 1 napon belül
(137 vélemény)
6.1
mibrahim070

I have more experience in c++ , I can finish this assignment in few hours , open chat for further details .

$20 CAD 0 napon belül
(2 vélemény)
2.1