Results 1 to 7 of 7
- 06-14-2011, 10:40 PM #1
Member
- Join Date
- Jun 2011
- Posts
- 10
- Rep Power
- 0
Help with a PolyGrapher Program ASAP
Hey everyone, I'm relatively new to Java and I desperately need help with a project. I'm not asking anyone to do it for me, just some direction would be helpful. Here's the assignment (there are a lot of directions): Assignment
This is what I have so far for the Polygrapher class:
To be honest, I'm just really lost...I don't know if I'm misunderstanding the instructions or what but any help would be greatly appreciated! Thank you.Java Code:import algoritharium.*; import java.util.Scanner; public class PolyGrapher { double q,w,e,rangeA,rangeB,x; public void plot() { Scanner in = new Scanner(System.in); System.out.println("Coefficient for x^3? "); q=in.nextInt(); System.out.println("Coefficient for x^2? "); w=in.nextInt(); System.out.println("Coefficient for x? "); e=in.nextInt(); System.out.println(q+"x^3"+w+"x^2"+e+"x"); System.out.println("What is min of the range? "); rangeA=in.nextInt(); System.out.println("What is max of the range? "); rangeB=in.nextInt(); } public double[] getGraphData (Polynomial p, double a, double b, int nPoints) { p=q*(x*x*x)+w*(x*x)+e*x; int max, min, sf; x=rangeA; max=p; x=rangeB; min=p; sf=graphHeight/( max - min ); System.out.print("yMin: "+min+" yMax: "+max+" sf: "+sf); } public void plotAndDifferentiate() { plot(); differentiate(p); graph(p); } }
- 06-14-2011, 11:52 PM #2
What is your problem? Go through your assignment and copy out the parts one by one that you are having a problem with. Paste them here and explain what your problem with that part.
- 06-15-2011, 03:07 AM #3
Member
- Join Date
- Jun 2011
- Posts
- 10
- Rep Power
- 0
I guess to start I have no idea how to create the Polynomial class. I'm sort of understanding the PolyGrapher class now but I keep getting errors because I need to write the Polynomial class for the program to work.
- 06-15-2011, 03:09 AM #4
please copy and paste the full text of the error messages here.I keep getting errors
What is that class supposed to do?I have no idea how to create the Polynomial class
- 06-15-2011, 03:31 AM #5
Member
- Join Date
- Jun 2011
- Posts
- 10
- Rep Power
- 0
It's supposed to model a polynomial and contain these methods:
public Polynomial(double [] coefficients)
public double evaluate(double x)
public Polynomial differentiate()
public String toString()
- 06-15-2011, 03:34 AM #6
So write the Polynomial class. Do it one method at a time and test that method works beofre moving onto the next. The toString method should be easiest so start there. As for the others, perhaps your assignment provides details of what they should do. If not I'm sure a Google search should provide info.
- 06-15-2011, 03:35 AM #7
Similar Threads
-
HELP with a plotter program ASAP!
By acole5 in forum New To JavaReplies: 3Last Post: 06-03-2011, 12:16 AM -
Please help me ASAP!
By Asvin in forum New To JavaReplies: 13Last Post: 05-17-2011, 05:55 PM -
Need help ASAP, please
By KAM0002 in forum New To JavaReplies: 6Last Post: 12-08-2010, 04:58 PM -
Assistance needed ASAP: Postpix program
By Debonairj in forum New To JavaReplies: 18Last Post: 07-27-2010, 01:37 PM -
Need help ASAP with Payroll Program Part 2
By arrech326 in forum New To JavaReplies: 10Last Post: 11-17-2009, 10:17 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks