Answer to Question #268001 in Visual Basic for ray

Question #268001

 Answer the following questions about the following initialized: 

                 Dim strPacificCapitals(11) As String

 

a.      Assign Apia to the first array location. What is the index number?

b.      Assign Honiara to the fourth location in the array. What would the assignment statement looks like?

c.      What value does strPacificCapitals.Length have?

d.      How many capitals can this array hold?

e.      What would happen if you assigned strPacificCapitals(11) = “Port Vila”?

 

1
Expert's answer
2021-11-22T09:54:52-0500
Imports System.IO


Module Module1
    Sub Main()


        Dim strPacificCapitals(11) As String
        strPacificCapitals(0) = "Apia"


        'a.      Assign Apia to the first array location. What is the index number?
        'Answer: the index number is 0
        'b.      Assign Honiara to the fourth location in the array. What would the assignment statement looks like?
        strPacificCapitals(3) = "Honiara"
        'c.      What value does strPacificCapitals.Length have? Answer: 12
        Console.WriteLine(strPacificCapitals.Length.ToString())
        'd.      How many capitals can this array hold? Answer: 12
        'e.      What would happen if you assigned strPacificCapitals(11) = “Port Vila”?
        strPacificCapitals(11) = "Port Vila"
        'Answer: nothing. You can assign "Port Vila" to the 11 array location.


        Console.ReadLine()
    End Sub
    
End Module

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