Please register to have access to more features!

It is highly recommended that you have Javascript enabled; many features will not work unless you do. The recommended browsers are Firefox and Chrome; the board is also NOT mobile-friendly.

Please invite your friends!

If you were referred by someone (ex. me, Jessica) please put their username in the referral box on the registration page. Ask them if you don't know their username.

If you are visiting for TESTING PURPOSES ONLY, this is the test account information:

Password: test123

Select a forum to post in:

Codebox plus

Moderator: Jessica

Codebox plus

Post Number: #1  Postby Jessica » April 27th, 2013, 3:47 pm

[code=vb file=Untitled.txt]'Class describing the application
Public Class exploreForm

Private Sub calculateAverage(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles goBtn.Click
Dim total As Integer
Dim count As Integer
Dim calculatedAverage As Double

If IsNumeric(firstInputTB.Text) And IsNumeric(secondInputTB.Text) Then
total = CInt(firstInputTB.Text)
count = CInt(secondInputTB.Text)
If (count > 0) Then
calculatedAverage = total / count
output.AppendText(CStr(calculatedAverage) & vbCrLf)
MessageBox.Show("Second value must be greater than 0")
End If
output.AppendText("Enter numeric values only")

End If
End Sub
End Class[/code]
  • 0

User avatar
Board Owner
Topic Author

8 years of membership8 years of membership8 years of membership8 years of membership8 years of membership8 years of membership8 years of membership8 years of membership
Posts: 3,468
Topics: 1,244
Articles: 30
Joined: December 22nd, 2010, 8:04 pm
Local time: May 24th, 2019, 12:29 am
Last Visit: Yesterday, 11:49 pm
Location: Pennsylvania
Gender: Female
Cash on hand: 4,690.51
Bank: 138,647.08
Reputation: 148
Medals: 20
#1: July 2012 1st Place (1) R-Contest #1 First Place (1) Best staff member 2013 (1) Easter Egg Hunt 2013 (1) Graphic Drawing Participant (1) 1 Year (1) 2 Years (1) 3 Years (1) 4 Years (1) 5 Years (1)
6 Years (1) 7 Years (1) 8 Years (1) Founder (1) Highest Rep (1) Referrer (1) Top poster (1) Facebook group (1) Pin-Board (1) Article Author (1)
Referrals: 27
Blog: View Blog (471)
Subject(s): Chinese, Math
Global Moderator

Return to Trasℎ Can

Login  •  Register
Reputation System ©'