Write a program that finds the Determinant (Delta) of the second-degree equation.
Equation: a*x2 + b*x + C = 0
Delta = b2 – 4*a*c
The output should be similar to the following:
Write a program that finds the Determinant (Delta) of the second-degree equation.
Equation: a*x2 + b*x + C = 0
Delta = b2 – 4*a*c
The output should be similar to the following:
Last edited by Alkhara Majere; 09-19-2007 at 02:07 PM.
15 ? Why not 16 rep :P ?
I thought the maximum rep-power is 15, not 16 O_o.
Alkhara is now the 16-rep d00d!
Edit : Sorry Majere =(.
Last edited by Remahlól; 09-19-2007 at 01:56 PM.
19/5/2013
Fine, 16 rep.
Keep it on topic.
determinant is b^2 - 4ac right? I'll have you an exe in a bit, hang on.
I don't want a .exe, I need the .cs file itself.
are u like some sort of genius at math?
Donator 6/2008.Contrib 8/2008.Elite 10/2008.Newsteam 11/2008.Legendary 2/2009.
Would imagine something like this.
Cept this didn't work for me.
class test
{
struct point
{
public int x;
public int y;
};
static void Main()
{
int deltaX;
p1.x=2; p1.y=1;
p2.x=7; p2.y=3;
Console.WriteLine(Distance(p1,p2));
}
static double Distance(point p1,point p2)
{
int deltaX, deltaY;
deltaX=p2.x - p1.x;
deltaY=p2.y - p1.y;
return Math.Sqrt(deltaX*deltaX + deltaY*deltaY);
}
}
Last edited by Alkhara Majere; 09-19-2007 at 02:14 PM.
No one has actually taken the assignment yet.
iam such a nub at this....i might try later tonight
Hey Piggy
if i wasnt such a mathtard id probably have a go
general pastebin - Chazwazza - post number 703865
Finished it in under a minute.
If you want another version with error handling and support for decimals and custom precision levels tell me.
EDIT: I did it anyway, new version with support for decimals and custom precision.
general pastebin - Chazwazza - post number 703881
Also, I noticed you doing some distance stuff, I wrote this last night too. It can find the distance between two points in any number of dimensions (> 2). eg P1(x,y,z,q,p) and P2(x,y,z,q,p)
It includes full error handling and support for decimals and custom precision levels.
general pastebin - Chazwazza - post number 703870
P.S. Both programs are coded in C++
P.S.S Got a math exam now, I'll be home in about 4 hours.
Last edited by Cypher; 09-19-2007 at 04:35 PM.
nerds...teach me!
poopdonkey.servegame.org