Results 1 to 2 of 2

Thread: A^2+b*+c=0

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2004
    Posts
    13

    Question A^2+b*+c=0

    I need to present a work until tomorrow in Visual beginner's
    all-purpose symbolic instruction code.Net, that it consists of deciding the equation of 2º Degree A*^2 + B* + C =0
    The environment goes to have 3 boxes of text a button and one label, each box of text corresponds to A B C of formulates, and label goes to present the result or the two results if the result
    will be greater that 0.

    But I need to make this on the basis of everything functions, the button to calculate goes to have very little code.

    Please help me, that is very important for me, and I do not perceive very of Mathematics.

    I go to leave in annex a little of the project to see as it will be the
    graphical environment, and the little that I obtained to make.
    Attached Files Attached Files

  2. #2
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682
    VB Code:
    1. Private Sub calc_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles calc_btn.Click
    2.     resultado_lbl.Text = descriminante(CInt(a_txt.Text), CInt(b_txt.Text), CInt(c_txt.Text))
    3. End Sub
    4.  
    5. Public Function descriminante(ByVal a As Integer, ByVal b As Integer, ByVal c As Integer) As Double
    6.     Return Math.Sqrt((b * b) - 4 * a * c)
    7. End Function

    I noticed your code sample was entitled "WindowsApplication15". You really need to start naming your programs properly. Read a few books on VB.net and take note of the coding conventions. A book is easily the best way to pick up a language like VB, its much harder doing it only via the internet.
    I don't live here any more.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width