Welcome! Log In Create A New Profile


Assignment 4, Ex 7.2

Posted by sanjivdo 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Assignment 4, Ex 7.2
July 10, 2007 09:15PM

I don't think I understand the question. Are we supposed to create an applet that plots any function. The function will be value in the parameter element in the HTML page. Is this correct?

I created the applet to plot a function but how do I create the function. I am confused. If the function is the parameter from the html, how do I create the function in code? If I use the getParameter() method it returns a string. Am I supposed to look at each character in the string and then try and interpret what to do?

Re: Assignment 4, Ex 7.2
July 15, 2007 09:35AM
Yes, from my understanding what you've said is all correct. The parameter will be passed in from the HTML page via the parameter tag. Once you have the function (represented in string format) in the applet, you have to interpret the function and plot its values. I'm not sure if I am correct here but just starting this question and this is the (current) path I'm taking.
Re: Assignment 4, Ex 7.2
July 25, 2007 01:09PM
Has anyone made further progress with this question?
I have no idea how to manipulate the string from x^3-3*x^2+5*x+8 into (Math.pow(x,3)) - (3 * (Math.pow(x,2)) + (5 * x) +8).

Suggestions anyone?
Re: Assignment 4, Ex 7.2
July 25, 2007 03:33PM

I am going to try and convert it to post fix notation and then parse the string. In COS211 assignment 2 there was a question to convert from prefix to postfix. Convert that code from c++ to java. Not sure if this will work. I am going to try it this weekend.

Re: Assignment 4, Ex 7.2
July 30, 2007 10:14AM
FYI, i've posted a separate thread on this forum giving another algorithm.
Sorry, only registered users may post in this forum.

Click here to login