Convenient way to represent polynomials

Assignment Help Accounting Basics
Reference no: EM13919983

Task

Linked lists are a convenient way to represent polynomials. Your task is to design a program that does some polynomial operations using a linked list.

A polynomial of degree ?? is defined as,

a0xm+a1xm-1+...+ am-1x1+am

The degree ?? is the largest exponent in any of the terms of the polynomial. For example, the largest exponent in 4x2-7x+3 is 2.

It is customary to write the term with the largest exponent first, followed by the term with the next largest exponent and so on.
ai s are the coefficients of the polynomial. One example of a polynomial of degree 6 is

2x6+x3+5x+4

in which the first term's coefficient is a0=2 and its power is 6; the second term's coefficient is a1=1 and its power is 3.

Tasks are detailed as follows

You are required to develop your own class to represent polynomials as a linked list. The first node in the list represents the first term in the polynomial, the second node represents the second term, and so forth.
Each node contains three fields. The first field is the term's coefficient. The second field is the term's power, and the third field is a pointer to the next term.

The following examples show how a polynomial is represented as a linked list.
5x4+6x3+7

2x3-7x2+3x

Notice that in the linked list:
1. The list has as many nodes as there are terms in the polynomial.
2. Each node in the linked list contains a value for the coefficient, a value for the exponent and a reference.
3. The nodes in the linked list are ordered. Nodes with a higher exponent precede nodes with a lower exponent.
4. The constant term has an exponent of 0.
5. The reference of the last node is NULL.

What to Implement (Task):

You should have at least two constructor for polynomials. One is used to build a polynomial (linked list) from a file and the other from keyboard input (pairs of coefficients and powers) by a user.
Implement polynomial addition by using an add() method, so you could write in program :
PolynomialThree= PolynomialOne.add(PolynomialTwo);

The rules for the addition of polynomials are as follows:
1. If the powers are equal, the coefficients are algebraically added.
2. If the powers are unequal, the term with the higher power is inserted in the new polynomial.
3. If the exponent is 0, it represents x0, which is 1. The value of the term is therefore the value of the coefficient.
4. If the result of adding the coefficients results in 0, the term is dropped (0 times anything is 0).
For example, the polynomial sum (27x3+15x2+12x)+(18x2+10x+8)is calculated as

27x3+33x2+22x+8

Get the value of a polynomial given an input. For instance, given x=2, the value of the polynomial x2+3x+2 is 12 .
Implement the product of a polynomial by another polynomial which is the algebraic sum of the products of one polynomial by all the monomials of another polynomial.
Implement the derivative operation for a polynomial. Note that for a monomial axk, its derivative is kaxk -1and the derivative of a constant is 0 and the derivative of a polynomial is equal to the sum of derivatives of its all monomials.
Implement a InsertTerm() method. This method should put the input term into a polynomial.
Test your program with the following two polynomials
12x9+5x6+13x5-4x4+2x3+11x2 - 6

7x9+2x8+5x6+2x5+2x3+9x2 - 7x

Write a driver program to test all the functionalities that you have defined

Reference no: EM13919983

Questions Cloud

Are the company business functions integrated : What has made the company you have chosen successful today? Discuss value chain activities/improvements. Are they customer focused, quality focused, low-price leader focused?
Program solution proposal : Unit 121 has a military flag football team here at Yongsan-Garrison located in Seoul South Korea. This is part of a base flag football team that maintains scores and a fairly accurate account of schedules, wins and losses.
Selection structure paper : Selection structures allow computer programs to perform different functions depending on if the condition of the function is true or false. Selection structures also enable the program to decide on a particular action based on the input of the use..
Describe the phases of the marketing process : Describe the phases of the marketing process. Describe the closed-loop control system of marketing management. Describe the dual closed-loop control system of market-oriented management.
Convenient way to represent polynomials : Task Linked lists are a convenient way to represent polynomials. Your task is to design a program that does some polynomial operations using a linked list.
Array structure proposal : If one has ample related information that needs to be accessed it is best if it's combined into one single group. A programmer can construct a program that can resolve this issue.
Dentify the financial statements on which each : Set up a table with the following headings. Identify the financial statements on which each of the preceding components appears by placing a check mark in the appropriate column.
What are kanban and 5s : What are Kanban and 5S, What are their origins, How does the approach you selected do this and How do you believe this should be accomplished this in his shop?
Phoenix homeless agency (pha) needs funds : Determine the strategies from your discussion group that you feel solves the funding needs for PHA the best.

Reviews

Write a Review

Accounting Basics Questions & Answers

  Littlejohn inc produces a subassembly used in the

littlejohn inc. produces a subassembly used in the production of hydraulic cylinders. the subassemblies are produced in

  Sanchez manufacturing purchases 45000 of raw materials on

sanchez manufacturing purchases 45000 of raw materials on account and it incurs 50000 of factory labor costs.supporting

  Accounting assumptions necessitate use of adjusting entries

What accounting assumptions necessitate the use of adjusting entries? What accounts are subject to adjusting journal entries?

  During the fiscal year ended 2010 a company has revenue of

during the fiscal year ended 2010 a company has revenue of 500000 expenses 360000 and an income tax rate of 35 what was

  Conceptual connection suppose that a third system system c

audiomart is a retailer of radios stereos and televisions. the store carries two portable sound systems that have

  What is opportunity cost and why is it an important concept

what is opportunity cost and why is it an important concept in the capital budgeting process? the opportunity cost

  Approximate value of the exports

Also assume that a U.S. exporter denominates its Swiss exports in Swiss francs and expects to receive SF600,000 in 1 year. Using the information above, what will be the approximate value of these exports in 1 year in U.S. dollars given that the fi..

  Pisa pizza parlor is investigating the purchase of a new

pisa pizza parlor is investigating the purchase of a new 50000 delivery truck that would contain specially designed

  Prepare all the necessary entries for information

The Feldbrand Corporation purchases 1,000 shares of IBM at $100 and 1,000 shares of Bell Labs at $125. It receives dividends of $1.00 per share on all shares. Prepare all the necessary entries for this information.

  Produce a valuation estimate for cermco for december 31

cermco produces and sells specialty customer relationship management crm solutions to small and medium-size businesses

  Violation of the profession ethical standard

A violation of the profession's ethical standards most likely would have occurred when a CPA:

  Finlon upholstery inc uses a job-order costing system to

finlon upholstery inc. uses a job-order costing system to accumulate manufacturing costs. the companys work-in-process

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd