akosiraff

Download Polynomial JAVA

Aug 5th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1.  
  2. Download: http://solutionzip.com/downloads/polynomial-java/
  3. CSE231: Assignment Three
  4. A polynomial of a real valued variable x is an expression of the form anx
  5. n + an-1x
  6. n-1 + … +
  7. a1x
  8. 1
  9. + a0 where a0, …, an are real constants, called coefficients. For instance, 2.5x
  10. 3
  11. +1.2x-5 is
  12. a polynomial of x with a3=2.5, a2=0, a1=1.2 and a0=-5. In this project, you are required to
  13. develop a class named Polynomial that supports symbolic manipulation of polynomials of a
  14. fixed variable x, that is, all polynomials are polynomials of the same variable x. Your class
  15. must at least support operations for
  16. 1. Constructing a polynomial given an array of coefficients. For example, given the
  17. float point number array {2.5,0.0,1.2,-5}, the operation constructs a Polynomial
  18. object representing 2.5x
  19. 3
  20. +1.2x-5. This is a constructor.
  21. 2. Adding one polynomial to another. For example, if this object represents
  22. 2.5x
  23. 3
  24. +1.2x-5 then adding another object representing 7x
  25. 4
  26. +2x
  27. 3
  28. +x
  29. 2
  30. +3 to this object
  31. changes this object so that it represents 7x
  32. 4
  33. +5.5x
  34. 3
  35. +x
  36. 2
  37. +1.2x–2. Note that the ranks
  38. (the largest exponent) of the two polynomials are not necessary the same.
  39. 3. Multiplying one polynomial by another. For example, if this object represents
  40. 2x
  41. 2
  42. +x-5 then multiplying it by another object representing 3x
  43. 3
  44. +x
  45. 2
  46. +3 changes this
  47. object so that it represents 6x
  48. 5
  49. +5×4
  50. -14×3
  51. +x2
  52. +3x-15. Again the ranks of the two
  53. polynomials are not necessary the same.
  54. 4. Evaluating a polynomial for a given value for x. For instance, if this object
  55. represents 2x
  56. 2
  57. +x-5 then evaluating it for x=2 yields 5.
  58. 5. Converting a Polynomial object to a string so that the Polynomial object can be
  59. displayed. If this object represents 3x
  60. 3
  61. +x
  62. 2
  63. -1 then the method should return
  64. “3*x^3 + x^2 – 1” although “3*x^3 + 1*x^2 + 0*x^1 + (-1)” is acceptable
  65. 1. Specify, design and implement Polynomial. Your implementation must use linked lists
  66. to represent polynomials.
  67. 2. Write an interactive test program that tests all the public methods of the Polynomial
  68. class.
  69. Please submit the following.
  70. ? Analysis: test data;
  71. ? Design:
  72. 1. Class diagrams showing representation of data;
  73. 2. A class invariant for each class;
  74. 3. Pre/Post conditions for required operations;
  75. 4. Algorithms for required operations. Algorithms can be described in English,
  76. flow diagrams, or sequence diagrams;
  77. ? Code;
  78. ? Screen snapshots of test runs.
  79.  
  80. Download: http://solutionzip.com/downloads/polynomial-java/
Add Comment
Please, Sign In to add comment