Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program C++ Program that asks the user to input two polynomials P1 and P2 (possibly of different degree). finds the smallest non-negative integer

Write a program C++ Program that

asks the user to input two polynomials P1 and P2 (possibly of different degree).

finds the smallest non-negative integer number x when the first polynomial exceeds the second (P1(x) > P2(x)).

To test your program: There is a property of the polynomials with non-negative coefficients that eventually the polynomial of the higher degree will exceed the polynomial of the lower degree (regardless of what the coefficients are). Check that this is the case, report your tested cases in the comments. (Be careful to make sure that your test cases dont cause integer overflows and other non-mathematical results. Feel free to use WolframAlpha or other external resources to find good polynomials for the tests.)

All dynamically allocated memory must be released by the end of the program.

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

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

Students also viewed these Databases questions