HELP ME SOON!!!PLEASEstill badly need help
Page 1 of 1
3 Replies - 835 Views - Last Post: 22 May 2001 - 08:59 PM
#1
HELP ME SOON!!!PLEASE
Posted 22 May 2001 - 07:48 AM
some code.
Ax^2+Bxy+Cy^2+Dx+Ey+F=0
z=b*b-(4*a*c)
if (z>0)
{
cout<<"Discriminant equals"<<z<<"2 real roots and the graph is Hyperbola";}
if (z=0)
{cout<<"Disc. equals"<<z<<"21 real root and the graph parabola";}
AND SO ON
PLEASE help me I don't know how to get this to work!!!I have to turn in my final today!!!!!
Replies To: HELP ME SOON!!!PLEASE
#2
Re: HELP ME SOON!!!PLEASE
Posted 22 May 2001 - 07:58 AM
Ok, i can answer since you did try on that, i know how much you need the help. I had this same program im not going to tell you who i be tho ;) Ok, its very simple you have the main idea for your equasion but try taking out the parenthasies(sp) like this b*b-4*a*c now, tell me whats wrong and why it wont work or what it is doing. heres a lil more that might help
try putting the cout for the discriminant above the if statements like this
cout<<"The discriminant =<<z<<endl;
if(z<0)
cout<<"blabla
";
if (z>0)
cout<<"blabla
";
//have else be if z=0 i had a problem until i did this
else
cout<<"blabla"; post again ill reply quick, just tryin to help ;)
#3
Re: HELP ME SOON!!!PLEASE
Posted 22 May 2001 - 08:28 AM
If that wording wasn't vey clear, try this: If z is greater than zero, do something. OTHERWISE, check if z is less than zero and do something. OTHERWISE, do something else. The OTHERWISE is the key.
Hopefully that's your problem. I don't see anything wrong with the code other than that. If it's still not working, try posting some more code and more information about what it's doing.
-Malkiri
#4
Re: HELP ME SOON!!!PLEASE
Posted 22 May 2001 - 08:59 PM
if(z<0) cout<<"blabla "; [color=blue]else if (z>0) [/color] cout<<"blabla "; else cout<<"blabla";
Malkiri is has said about your code which I have write in blue. Look at there and think about if Z is -1 then what gose wrong and where in your code ? I have fix this problem but I want to know that you have understand this or not so explain it to me.
[color=blue]
(Edited by kalpeshmjoshi at 4:09 am on May 23, 2001)
|
|

New Topic/Question
Reply




MultiQuote



|