Welcome

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:


Username:
Test
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)
Else
MessageBox.Show("Second value must be greater than 0")
End If
Else
output.AppendText("Enter numeric values only")

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

User avatar
Jessica
Board Owner
Topic Author

Founder
Sapphire
Sapphire
 
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,465
Topics: 1,244
Articles: 30
Joined: December 22nd, 2010, 8:04 pm
Local time: March 18th, 2019, 7:42 pm
Last Visit: Today, 5:35 pm
Location: Pennsylvania
Gender: Female
Cash on hand: 4,655.11
Bank: 132,045.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 (468)
Subject(s): Chinese, Math
Global Moderator
Admin
Moderator

Return to Trasℎ Can

Login  •  Register
cron
Reputation System ©'