Answer to Question #268008 in Visual Basic for ray

Question #268008

1.      Using implicit sizing, assign the integers 2, 3, 5, 7, 11, and 13 to an array named intPrimeNumbers. 


3.    Rewrite the code below to read each line of a text file into an array named strFordModel.




1
Expert's answer
2021-11-24T13:49:28-0500
1.
Dim intPrimeNumbers() As Integer = {2, 3, 5, 7, 11, 13}

2.
Imports System.IO




Module Module1








    Sub Main()
        Dim strFordModel(1000) As String
        Dim intCount As Integer = 0
        Dim objReader As StreamReader
        objReader = New StreamReader("Model.txt")




        Do While objReader.Peek <> -1
            strFordModel(intCount) = objReader.ReadLine()
            intCount += 1
        Loop
        objReader.Close()
        For i As Integer = 0 To intCount - 1
            Console.WriteLine(strFordModel(i))
        Next








        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