Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The Ploynom.cc file: #include \"Polynom.h\" #include <iostream> #include <iomani

ID: 3597638 • Letter: T

Question

The Ploynom.cc file:

#include "Polynom.h"
#include <iostream>
#include <iomanip>
using namespace std;

Polynom::Polynom(){

// implementation needed
}

Polynom::Polynom(const vector<int>& coeff){

// implementation needed
}

const Polynom& Polynom::operator+(const Polynom& RHS) const {

// implementation needed
}

const Polynom& Polynom::operator-(const Polynom& RHS) const {

// implementation needed
}

double Polynom::operator()(double x) const{

// implementation needed
}

ostream& operator<<(ostream& ostr, const Polynom& RHS){

// implementation needed
}

bool Polynom::setCoeff(int k, int c) {
  
// implementation needed
}

bool Polynom::getCoeff(int k, int& c) {

// implementation needed
}

ostream& Polynom::insert(ostream& ostr) {

// implementation needed

In this assignment you will define, implement, and test a C+ class called Polynom to represent and use polynomials, A polynonial function of independent variable r can be written as The highest power of variable that occurs in the polya (in this case ) is called the degree of the polynomial. The quantities an,do are constants known as coefficients. In this assignment coefficients are int type and can be positive, negative, or 0. A basic operation for polynomials is to evaluate a polynomial at a specific value of r. For example, we can evaluate the quadratic polynomial r) q(z) =12 + 5r + 6 for for r-2, by writing the polynomial in the following form, and then substituting2 to obtain, g(2) ((25)2 +6)-(7)2+6)-(146)-20 We can add two polynomials and subtract one from the other. Examples are shown below p(z) = 3r, + 2r2 +1 + 16, q(1)-12 + 51 + 6 -3r' + 3r2 +6r +22 3+(-4)r+10 p(z) + q(z) _ (3 + 0)rs + (2 + 1):r" + (1 +5)| + (16 + 6) p(r)- g(r)-(3-0)(2 (1-5)(16-6) A simple way to represent a polynomial object of degree n is to use a vector of length n+1 to store the coefficients. For example, the polynomsp and q can be represented by vectors of length 4 and 3, respectively. p: 3 21 16, :1 5 6 It is possible that some of the coefficients in a polynomial are 0. Considr the polynomial r(r) = 5r9 + 2A + 19 where the largest power of is 9 so that we need a vector of length 10 to store the polynomial: r:50000 2000 6 This ament asks you to implement the functions that appear in Polynom.cc according to the specification provided in the decription given above.

Explanation / Answer

#include "Polynom.h"
#include <iostream>
#include <iomanip>
using namespace std;

Polynom::Polynom(){

// implementation needed
}

Polynom::Polynom(const vector<int>& coeff){

// implementation needed
}

const Polynom& Polynom::operator+(const Polynom& RHS) const {

// implementation needed
}

const Polynom& Polynom::operator-(const Polynom& RHS) const {

// implementation needed
}

double Polynom::operator()(double x) const{

// implementation needed
}

ostream& operator<<(ostream& ostr, const Polynom& RHS){

// implementation needed
}

bool Polynom::setCoeff(int k, int c) {
  
// implementation needed
}

bool Polynom::getCoeff(int k, int& c) {

// implementation needed
}

ostream& Polynom::insert(ostream& ostr) {

// implementation needed

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote