about | help | code help+videos | done | prefs |
For this problem you will write a polynomial parser. It will accept a string representation of a polynomial function and an integer value for x. Your method will then return a double that is equivalent to the y-value output of that function for the given x-value input parameter. The polynomial will have positive integer coefficients and non-negative single-digit integer exponents. Exponents of 1 or 0 must be explicit in the polynomial and may NOT be implied (for example "y=x+2" must be passed in as "y=1x^1+2x^0"). All coefficeints must be explicitly indicated, so "y=x^2" must be passed in as "y=1x^2" polyParse("y=2x^6+5x^8+3x^1", 0) → 0.0 polyParse("y=5x^1+6x^0", -4) → -14.0 polyParse("y=1x^2+5x^1+6x^0", 3) → 30.0 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 380 Post-solution available
Copyright Nick Parlante 2017 - privacy