Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions