Tuesday, June 30, 2009
To determine prime number
Function determinePrime(ByVal x As Integer) As Boolean
For a = 2 To x / 2
If x Mod a = 0 Then
Return False
End If
Next
Return True
End Function
For a = 2 To x / 2
If x Mod a = 0 Then
Return False
End If
Next
Return True
End Function
Thursday, June 25, 2009
OOP ** Four Questions! **
- What is object oriented programming?
- What is a class?
- What is an object?
- What is an attribute?
Tuesday, June 23, 2009
First blog post
What do you hope to accomplish by the end of the course?
Next, copy sample code from the Console applications as well as from the GUI application that we created.
Next, copy sample code from the Console applications as well as from the GUI application that we created.
Miles per gallon program!
'Ask the user for the distance they travelled (in miles)
'ask the user how much gas they used (in gallons)
'calculate the miles per gallon and determine whether the
'driver is getting a good miles per gallon!
'ask the user how much gas they used (in gallons)
'calculate the miles per gallon and determine whether the
'driver is getting a good miles per gallon!
Saturday, June 6, 2009
Program
'read in a user's name. If the name is longer than 10 characters, tell
'the user their name is too long. Otherwise give them a friendly greeting!
'make a Function. Give it an appropriate name.
'the user their name is too long. Otherwise give them a friendly greeting!
'make a Function. Give it an appropriate name.
On your blog...
I would like for you to define:
- Sub routine
- Function
- Algorithm
- Namespace
- "My" as it relates to Visual Basic .NET
largest number function
Function largestNumber(ByVal num1 As Integer, ByVal num2 As Integer, ByVal num3 As Integer) As Integer
Dim largestNum = num1
If num2 > largestNum Then
largestNum = num2
End If
If num3 > largestNum Then
largestNum = num3
End If
Return largestNum
End Function
Dim largestNum = num1
If num2 > largestNum Then
largestNum = num2
End If
If num3 > largestNum Then
largestNum = num3
End If
Return largestNum
End Function
First assignment, third class
'make a sub routine that takes in a number and print out
'that number squared!
'that number squared!
Subscribe to:
Posts (Atom)