• Small Basic Programming Help
    2 replies, posted
So after doing no programming for around 5-7 months and attempting to come back to it as a way to help learn my math(and raise my math grade in Algebra II) I had attempted to write a program to solve rational Equations for me, but every time I try to get it to tell me if I have a correct answer it just won't go through the if,then,else statement correctly and say it is wrong every time Here is what I have so far Here is an equation I know is correct that the program is telling me that it is wrong Y/3 + Y/7 = 10 Now the correct answer is Y = 21 [CODE]TextWindow.Title = "Solving Rational Equations" TextWindow.WriteLine("Solving Rational Equations") TextWindow.WriteLine("Y/X1 + Y/X2 = A") TextWindow.WriteLine(" Enter a Number for X1") X1 = TextWindow.Read() TextWindow.WriteLine(" Enter a Number for X2") X2 = TextWindow.Read() TextWindow.WriteLine(" Enter a Number for = A") A = TextWindow.Read() LCD = (X1 * X2) TextWindow.WriteLine("Y = "+LCD) DP1 = (LCD * X1) DP2 = (LCD * X2) DP3 = (LCD * A) LT = (DP1 + DP2) Y = (DP3 / LT) Answer = (Y / LCD) If(Answer = 0) Then TextWindow.WriteLine("Y = "+Answer) Else TextWindow.WriteLine("There is no solution") EndIf[/CODE] I just need to know what I have to do it fix it :/ Here is picture I fractaled for all that help me [IMG]http://i.imgur.com/yhJ3xOb.jpg[/IMG]
You don't need to devide Y by LCD. Y = (DP3 / LT) it is your actual answer.
[QUOTE=OldFusion;40694797]You don't need to devide Y by LCD. Y = (DP3 / LT) it is your actual answer.[/QUOTE] That is there to check to see if the answer it gave me from Y = (DP3 / LT) and the LCD so see if it equals zero EDIT: and if it does equal zero it is supposed to say "Y = (*insert correct number here*)" and if it does not equal zero then it will say that there is no solution to it
Sorry, you need to Log In to post a reply to this thread.