troubleshooting Question

pass x*x*x - 3*x*x +5*x + 8 in HTML file so java make it a single-variable polynomial

Avatar of jxharding
jxharding asked on
Java
2 Comments2 Solutions254 ViewsLast Modified:
hi, i need to parse the string x*x*x - 3*x*x +5*x + 8; so that i can pass it into HTML and java knows what to do with it.

here is a question that i can do: (correct and verified) it has to do with the question that im asking
y = 0.5 x ^ 3 = x * x * x * 0.5                                             ^
// Class PlotD plots y = x^3 - 3x^2 + 5x + 8
public class PlotD extends Plotter {
public double func(double x) {
return x*x*x - 3*x*x +5*x + 8;
}
}

this one i need help on :
Now i have a generic plotter question:
write a generic plotter applet that takes a parameter func that represents a single-variable polynomial function and plots the function.
For example, the input might be in the form
x^3 - 3 * x^2 +5*x + 8
 
somehow in the html file it seems i need to pass this value and somehow parse it so that java knows what to make of it.

<!--Plotter.html-->
<HTML>
  <HEAD>
     <TITLE> The Plotter Applet </TITLE>
  </HEAD>
<BODY BGCOLOR=black TEXT=white>
  <CENTER>
    <H1> The Plotter Applet</H1>
      <P>
        <APPLET CODE=PlotD.class
               WIDTH=1250 HEIGHT=1150>
        <PARAMETER NAME=myval VALUE=x*x*x -3*x*x + 5*x + 8 >
        </APPLET>
  </CENTER>
</BODY>
</HTML>

one i cant do:
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros