Answer to Question #268000 in Visual Basic for ray

Question #268000

1) Write a procedure that will compute and return the average of three numbers. The procedure should have three parameters of type double representing the numbers to be averaged. (for example the average of x, y and z is given by (x+y+z)/3.0) 

2) what is the output of the following code? 

Private Sub btnBedrockClick(ByVal sender As System.Object, ByVal e As System.EventArgs)

   Dim strFullName As String = “Jonah Lomu”

   Dim strSecondName As String = “Va’inga Tuigamala”

   CountLength(strFullName, strSecondName)   lblEnd.Text = “My favorite was ” & strSecondName

End Sub

Private Sub CountLength(ByVal strFullName As String, ByRef strSecondName As String)

   lblFirst.Text = “The first name has ” & strFullName.Length & “ letters.”   lblSecond.Text = “The second name has ” & strSecondName.Length & “ letters.”

   strSecondName = “Joe Rokocoko”

End Sub

 


 

1
Expert's answer
2021-11-21T17:34:31-0500
Question 1

Imports System.IO


Module Module1
    Sub Main()
       


        Console.WriteLine("Average: " & computeAverage(5, 5, 8))




        Console.ReadLine()
    End Sub
    Function computeAverage(ByVal x As Double, ByVal y As Double, ByVal z As Double)
        Return (x + y + z) / 3.0
    End Function


End Module

Question 2

Answer:
The first name has 10 letters.
The second name has 17 letters.
My favorite was Joe Rokocoko

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS