Question: Make a program that can do mathematical operations with monomials (+, -, *), say F (x) and G (x) where each monomial will be described

Make a program that can do mathematical operations with monomials (+, -, *),

say F (x) and

G (x)

where each monomial will be described as ax ^ n

For example:

F(x) = 2x^3

G(x) = 5x^3

F(x) + G(x) = 7x^3

F(2) + G(2) = 56

Make a class called Monomio. The private attributes will be:

int coeficiente

int exponent

Must do all 3 types of builders

(Default, parameter, copy), setters, and getters.

The class must be able to do the following re-definition of +, - and * operators. Remember to keep the operations of the monomials. In addition to the re-definition of operators must do << and >>. You should also be able to evaluate the monomial (see previous example).

If you can not make an operation (+ or -) display an error message.

The output of the monomial should be something like 2x ^ 3 for example.

Make a program where you can demonstrate the example above.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!