|
-
Jun 19th, 2006, 03:36 PM
#1
Thread Starter
New Member
Using the Quadratic expression help...
so i have this so far but im stuck on adding 2 quadratic expressions not sure what i need to return
public class Quadratic
{
private int a,b,c;
public Quadratic()
{
a = 0;
b = 0;
c = 0;
}
public Quadratic(int userA,int userB,int userC)
{
a = userA;
b = userB;
c = userC;
}
public int getA()
{
return a;
}
public int getB()
{
return b;
}
public int getC()
{
return c;
}
public int getEval(int x)
{
int answer;
answer = (a*(x*x)) + (b*x) + c;
return answer;
}
public static Quadratic sum(Quadratic q1, Quadratic q2)
{
int qsumA, qsumB, qsumC;
qsumA = q1.getA() + q2.getA();
qsumB = q1.getB() + q2.getB();
qsumC = q1.getC() + q2.getC();
Quadratic qsum = new Quadratic(qsumA,qsumB,qsumC);
return qsum;
}
}
Last edited by bckck5; Jun 19th, 2006 at 04:11 PM.
-
Jun 19th, 2006, 05:11 PM
#2
Re: Using the Quadratic expression help...
This seems to be right!!
I don't know what is the problem here!!!
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Jun 19th, 2006, 09:17 PM
#3
Thread Starter
New Member
Re: Using the Quadratic expression help...
 Originally Posted by ComputerJy
This seems to be right!!
I don't know what is the problem here!!! 
yea its right the problem was in my test program but i figured it out
i may have one more qeustion then i will mark this resolved
thanks for looking tho
Last edited by bckck5; Jun 19th, 2006 at 10:14 PM.
Reason: Resolved
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|