Algorithm Workbench (Visual Basic 2013/2015)


Algorithm Workbench (Visual Basic 2013/2015)




1.) The following statement calls a function named half that returns a Decimal, which is half of the argument. Write the function.


decResult = Half (intNumber)




2.) An application contains the following function:


Function Square (ByVal intValue As Integer) As Integer


Return intValue ^ 2


End Function




3.) Write a procedure named TimesTen that accepts a single Integer argument. When the procedure is called, it should display the product of its argument multiplied by 10 in a message box.




4.) An application contrains the following procedure:


Sub Display(ByVal intArg1 As Integer, ByVal strArg2 As String, ByVal sngArg3 As Single)


MessageBox.Show ("Here are the values: " &


intArg1.ToString() & " " &


strArg2 & " " & sngArg3.ToString() )


End Sub




Write a statement that calls the procedure and passes it the following variables:


Dim strName As String


Dim intAge As Integer


Dim sngIncome As Single






Powered by