subject

Programming Assignment 1 Polynomial
In this assignment, you will implement a polynomial and operations on it using a linked list.
Worth 60 points (6% of course grade)
Background
Read Section 3.1 in the textbook for background on polynomials and polynomial arithmetic.
A polynomial may be represented using a linked list as follows: for every term in the polynomial there is one entry in the linked list consisting of the term's coefficient and degree. The entries are ordered according to ASCENDING values of degree, i. e. lowest degree term first, then next lowest degree term and so on, all the way up to the highest degree term. IMPORTANT: Zero-coefficient terms are NOT stored.
For example, the following polynomial (the symbol '^' is used to mean 'raised to the power'):
4x^5 - 2x^3 + 2x +3
can be represented as the linked list of terms:
(3,0) -> (2,1) -> (-2,3) -> (4,5)
where each term is a (coefficient, degree) pair.
Notes about representation:
Terms are stored in ASCENDING order of degrees from front to rear in a non-circular linked list.
Zero-coefficient terms are NOT stored.
An EMPTY (zero) polynomial is represented by a linked list with NO NODES in it, i. e. referenced by NULL.
Coefficients are real numbers
Degrees are POSITIVE integers, except if there is a constant term, in which case the degree is zero.
There will not be more than one term in the same degree.
If you do not represent all your polynomials (the initial inputs as well as those you get out of doing arithmetic on polynomials) as above, you will lose credit even if your results are mathematically correct.
Running the program
There are three sample input files for you to test (they should be under the project folder in Eclipse):
A file ptest1.txt that contains the polynomial
4x^5 - 2x^3 + 2x + 3
A file ptest2.txt that contains the polynomial
8x^4 + 4x^3 - 3x + 9
A file ptest1opp. txt that contains the polynomial
-4x^5 + 2x^3 - 2x - 3
(the negation of the polynomial in ptest1)

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 20:20, jazzy4211
Sometimes writers elaborate on the truth when recalling past events so they can enhance their narrative essay with more interesting descriptions. do you feel that published writers should or should not embellish real life events just to make their stories more interesting?
Answers: 2
image
Computers and Technology, 22.06.2019 02:00, itsyagirl11076
What is the process in which the software development team compiles information to determine the final product.
Answers: 3
image
Computers and Technology, 23.06.2019 06:30, Knownothing
When early motion pictures played in movie theaters, they were often accompanied by live organ or piano music. which of the following are the most likely reasons that this happened? (select all that apply). the music was provided to distract audience members from the loud sounds made when filmstrips were changed. the music accompanied the movies because the movies were silent and audiences were used to hearing music during plays in theaters. the music usually was played before, and sometimes after the movie, as an alternative form of entertainment. the music viewers to interpret the dramatic action in the films.
Answers: 2
image
Computers and Technology, 23.06.2019 17:30, Annlee23
When making changes to optimize part of a processor, it is often the case that speeding up one type of instruction comes at the cost of slowing down something else. for example, if we put in a complicated fast floating-point unit, that takes space, and something might have to be moved farther away from the middle to accommodate it, adding an extra cycle in delay to reach that unit. the basic amdahl's law equation does not take into account this trade-off. a. if the new fast floating-point unit speeds up floating-point operations by, on average, 2ă—, and floating-point operations take 20% of the original program's execution time, what is the overall speedup (ignoring the penalty to any other instructions)? b. now assume that speeding up the floating-point unit slowed down data cache accesses, resulting in a 1.5ă— slowdown (or 2/3 speedup). data cache accesses consume 10% of the execution time. what is the overall speedup now? c. after implementing the new floating-point operations, what percentage of execution time is spent on floating-point operations? what percentage is spent on data cache accesses?
Answers: 2
You know the right answer?
Programming Assignment 1 Polynomial
In this assignment, you will implement a polynomial and o...

Questions in other subjects: