40011: Assume that s is a string variable that is supposed to contain a value to be converted to integer. Write a fragment of code that converts the value to integer variable and displays that value multiplied by 2. If the value cannot be converted, display the message 'Invalid number' instead.
Try
MessageBox.Show(CInt(s) * 2)
Catch
MessageBox.Show("Invalid number")
End Try
40442: eurasiaSales = add(euroSales, asiaSales)
ReplyDelete40443: cubeVolume = toThePowerOf(cubeSide, 3)
40804: sqrt((a*a)+(b*b))
40458:
Function twice(parameter1 As Integer)
DIM result As Integer = parameter1 * 2
return result
End Function
40459:
Function add(parameter1 As Integer, parameter2 As Integer)
DIM sum As Integer = parameter1 + parameter2
return sum
End Function
40455: max(max(population1, population2), max(population3, population4))
ReplyDelete40801: sqrt(sqrt(x))
40802: twice(twice(twice(x)))
ReplyDelete40803: oneMore(oneMore(oneMore(oneMore(x))))
ActiveX Controlsvb coding examples
ReplyDelete