Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(C++ Dynamic arrays problem) Hello, I need help to write a program about polynomial multiplication by using a dynamic arrays.(Only using C++) Here's an instruction,

(C++ Dynamic arrays problem) Hello, I need help to write a program about polynomial multiplication by using a dynamic arrays.(Only using C++)

Here's an instruction, please follow it thoroughly.

For this problem, you must write code that can multiply polynomials together (i.e. FOIL at a arbitrary high dimension).

First you should prompt the user for the number of coefficients and then read each coefficient (starting from the constant term).

Repeat this a second time for a second polynomial. You must use dynamic memory to assign these polynomials.

You should also delete all dynamically created variables before the end of your program. (You do not need to use a class to store these polynomials as we used in Lab 9 Workout 1.) Once you have these two polynomials, find the product of the two polynomials. (Hint: It might be easiest to make a third dynamic array.) Ensure that your formatting matches the examples below.

You can assume that the coefficients of the polynomials are all integers. You can also assume the polynomials have at least one coefficient

examples(a code should follow the exact output below.

image text in transcribedimage text in transcribedimage text in transcribed

Example 1 (user input is underlined): How many coefficients are in the first polynomial? 3 What are the coefficients (lowest power first)? 3_21 How many coefficients are in the second polynomial? What are the coefficients (lowest power first)? 121 (3) (2) xA1(1)xA2 times (1) (2) xA1(1)xA2 3 (3) (8) xA1 (8) xA2 (4)xA3(1)xA4

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

Spatial Databases With Application To GIS

Authors: Philippe Rigaux, Michel Scholl, Agnès Voisard

1st Edition

1558605886, 978-1558605886

More Books

Students also viewed these Databases questions