| | My first program | |
| | Author | Message |
---|
Torrentspy Administrator
Number of posts : 843 Location : hidding Points : 574 Character : Torrent_Spy GunZ Exp (nub/pro) : Registration date : 2009-01-15 Reputation : -2
| Subject: My first program Sun Apr 19, 2009 7:36 am | |
| Hi, well I made a seeming simple coded program, but the code needs somewhat knowlege about second equations & imagination numbers! this program may help you when you solve second degree equations, example, solve : x^2 -3x+5 =0 what should be 'X' ? well my program gets it in 1 click so easy xD I coded hard on it, not to code it was hard, to converte the maths to code was pretty not easy! I had some problems with imagination numbers, for those who don't know what imagination numbers are, ... what is the square root of -1 ?? well you will say, no square roots for negative numbers, so they are called imagination (not real), we just put square -1 as i, I mean square root -1 = i, and square root of -9 = (square root 9) * (square root -1) = 3 * i so we can continue solving, that was a kinda hard part to make this known for visual baisc xD anyway ok I will stop talking too much ^^ and here is the program xD Version 2http://www.zshare.net/download/58890535f579bbc7/unpack it, and open torrentspy.exe have fun =)
Last edited by Torrentspy on Sun Apr 19, 2009 3:01 pm; edited 1 time in total | |
| | | Tittenfee Retired Staff
Warnings : 2.99
Number of posts : 2522 Age : 30 Location : Austria, Vienna Points : 2583 Character : Tittenfee, _NPC_ GunZ Exp (nub/pro) : Registration date : 2009-01-22 Reputation : 22
| Subject: Re: My first program Sun Apr 19, 2009 8:12 am | |
| rofl ur programm can solve quadratic equations! which formula does it use? the PQ or the other one? | |
| | | Snake Retired Staff
Number of posts : 3572 Age : 31 Location : UK Points : 3473 Character : GunZ Exp (nub/pro) : Registration date : 2009-02-02 Reputation : 27
| Subject: Re: My first program Sun Apr 19, 2009 10:45 am | |
| Hmmm this is pretty random...lol Good job nevertheless. | |
| | | TheGod Kore
Number of posts : 1194 Location : Behind you Points : 1087 Character : Demantor
God GunZ Exp (nub/pro) : Registration date : 2008-11-19 Reputation : -9
| Subject: Re: My first program Sun Apr 19, 2009 1:05 pm | |
| Nice, but:1) This is not your first program. 2) This is based on the very basics in Visual Basic programming. 3) Btw, mathematical solvers are the easiest things which can be coded and that's the first thing you should learn when you start. 4) + I hate Torrents way in witting a program, its based too simple, nothing complicated. 5) Torrent made this program in minutes, why saying that's your first program? /owned, xD Stay cool, it's still nice = ) but don't say it's your first program | |
| | | Torrentspy Administrator
Number of posts : 843 Location : hidding Points : 574 Character : Torrent_Spy GunZ Exp (nub/pro) : Registration date : 2009-01-15 Reputation : -2
| Subject: Re: My first program Sun Apr 19, 2009 1:09 pm | |
| - Tittenfee wrote:
- rofl ur programm can solve quadratic equations! which formula does it use? the PQ or the other one?
I used the basic : [(-b+(b^2-4ac))^(1/2)]/(2a) and [(-b-(b^2-4ac))^(1/2)]/(2a) thats for real numbers, when imagination numbers I used some other tricks, I can explain it, and release it if u want^^ - Demantor wrote:
- Nice, but:
1) This is not your first program. 2) This is based on the very basics in Visual Basic programming. 3) Btw, mathematical solvers are the easiest things which can be coded and that's the first thing you should learn when you start. 4) + I hate Torrents way in witting a program, its based too simple, nothing complicated. 5) Torrent made this program in minutes, why saying that's your first program?
/owned, xD
Stay cool, it's still nice = ) but don't say it's your first program 1- my first program that I release 2- I said code is simple, but to converte maths to code was not easy 3- True, but not when u work with imagination numbers, I helped u once with imagination numbers problem, remember* 4- Simple and working is the secret of success, and it is not so simple as u think coz of its size^^ 5- Minutes, but needed to fix many things, and btw: u made something like that but failed I remember? xD ya I gave u the code and some fixes now I think u got it? Edited my post : I made a new version2, with something fixed^^ edited main post link Don't forget thanks button | |
| | | Snake Retired Staff
Number of posts : 3572 Age : 31 Location : UK Points : 3473 Character : GunZ Exp (nub/pro) : Registration date : 2009-02-02 Reputation : 27
| Subject: Re: My first program Sun Apr 19, 2009 4:39 pm | |
| There is no thanks button | |
| | | Torrentspy Administrator
Number of posts : 843 Location : hidding Points : 574 Character : Torrent_Spy GunZ Exp (nub/pro) : Registration date : 2009-01-15 Reputation : -2
| Subject: Re: My first program Mon Apr 20, 2009 4:23 am | |
| here is it^^ | |
| | | Snake Retired Staff
Number of posts : 3572 Age : 31 Location : UK Points : 3473 Character : GunZ Exp (nub/pro) : Registration date : 2009-02-02 Reputation : 27
| | | | Tittenfee Retired Staff
Warnings : 2.99
Number of posts : 2522 Age : 30 Location : Austria, Vienna Points : 2583 Character : Tittenfee, _NPC_ GunZ Exp (nub/pro) : Registration date : 2009-01-22 Reputation : 22
| Subject: Re: My first program Mon Apr 20, 2009 10:40 am | |
| | |
| | | Torrentspy Administrator
Number of posts : 843 Location : hidding Points : 574 Character : Torrent_Spy GunZ Exp (nub/pro) : Registration date : 2009-01-15 Reputation : -2
| Subject: Re: My first program Mon Apr 20, 2009 11:27 am | |
| rofl then just test the program Try to get any bug, I mean like stopped responsing/awsome error message -- because I don't think u can find one! btw: the error message saying u have entered value 'a' as zero or left empty........ this I wrote if the value a is 0, so find another one^^ I release my source code for those who are noobs I am ready to explain it lol *'Calculate' button code : ------------------------------------------------------------------------------------------------------------------- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim a, b, c, x, y, j, jx, js As Double 'some characters to handle them a = Val(text1.Text) 'a in aX^2 value b = Val(text2.Text) 'b in bX value c = Val(text3.Text) 'c in +c value x = -b / (2 * a) 'real number part j = (b ^ 2 - 4 * a * c) ^ (1 / 2) ' the normal sqr (real) js = (b ^ 2 - 4 * a * c) 'real/imagination checker jx = -1 * (b ^ 2 - 4 * a * c) ' the sqr with changed sign (from '-' to '+') to use in imagination numbers y = ((-js) ^ (1 / 2)) / (2 * a) 'imagination number half If Val(a) = 0 Then 'checks if the value 'a' is 0 or empty, val means value MsgBox("You have entered value box X² for 'a' zero or left it empty, so this equation is nomore a second-degree one, please rewrite the correct information", MsgBoxStyle.Critical, "Error message!") Beep() ElseIf js >= 0 And a <> 0 Then 'checks if the roots are real, and if the equation is a second degree one text4.Text = (-b + j) / (2 * a) text5.Text = (-b - j) / (2 * a) Label11.Text = "Roots are real" ElseIf js < 0 And a <> 0 And x <> 0 And y <> 0 And y <> -1 And y <> 1 Then 'roots are imagination, real part is not=0, imagination part is not=0 text4.Text = x & "+" & y & "i" text5.Text = x & "-" & y & "i" Label11.Text = "Roots are not real, i=√-1" ElseIf js < 0 And a <> 0 And x = 0 And y <> 0 And y <> 1 And y <> -1 Then 'roots are imagination, real part=0, Imagination part is not=0 and not=-1 and not=1 text4.Text = y & "i" text5.Text = "-" & y & "i" Label11.Text = "Roots are not real, i=√-1" ElseIf js < 0 And a <> 0 And x <> 0 And y = 1 Then 'roots are imagination, real part is not=0, Imagination part is=1 text4.Text = x & "+i" text5.Text = x & "-i" Label11.Text = "Roots are not real, i=√-1" ElseIf js < 0 And a <> 0 And x <> 0 And y = -1 Then 'roots are imagination, real part is not=0, Imagination part is=-1 text4.Text = x & "+i" text5.Text = x & "-i" Label11.Text = "Roots are not real, i=√-1" ElseIf js < 0 And a <> 0 And x = 0 And y = 1 Then 'roots are imagination, real part is=0, Imagination part is=1 text4.Text = "i" text5.Text = "-i" Label11.Text = "Roots are not real, i=√-1" ElseIf js < 0 And a <> 0 And x = 0 And y = -1 Then 'roots are imagination, real part is=0, Imagination part is=-1 text4.Text = "i" text5.Text = "-i" Label11.Text = "Roots are not real, i=√-1" End If '1 thing: 'y' which is the imagination part never gets value=0 when js<0, because y(numerator) is not=0 then! End Sub-------------------------------------------------------------------------------------------------------------- well any thing begins with ' means this is not code, its explanition without apply(can remove it or let it will not matter) *About button code : ------------------------------------------------------------------------------------------------------------------------------------------ Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click MsgBox("This program was made by : Torrentspy, E-mail address : torrent_spy_12@yahoo.com" + vbCrLf + "Version: 2", MsgBoxStyle.Information, "About Information!") Beep() End Sub------------------------------------------------------------------------------------------------------------------------------------ '+vbcrlf+' is like when u press enter *clear all button code : --------------------------------------------------------------------------------------------------- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click text1.Text = "" text2.Text = "" text3.Text = "" text4.Text = "" text5.Text = "" Label11.Text = ""
End Sub--------------------------------------------------------------------------------------------- I knowwwww, all vb coders will say this program is so fux basic coded, but ya it's bug free! and imagination numbers work on it | |
| | | TheGod Kore
Number of posts : 1194 Location : Behind you Points : 1087 Character : Demantor
God GunZ Exp (nub/pro) : Registration date : 2008-11-19 Reputation : -9
| Subject: Re: My first program Tue Apr 21, 2009 3:10 am | |
| I know your program is simple, but i will start fixing some of your code bugs = ) and make it a bit better lol | |
| | | Sponsored content
| Subject: Re: My first program | |
| |
| | | | My first program | |
|
Similar topics | |
|
| Permissions in this forum: | You cannot reply to topics in this forum
| |
| |
| |