Solved

Which of the Following Code Segments Writes the Contents of Three

Question 6

Multiple Choice

Which of the following code segments writes the contents of three parallel arrays named strStudentName, intID, and strMajor to a file in the format below? Assume all arrays have the same number of elements. Vince Student, 1234, Computer Science
Nancy Student, 4321, Electrical Engineering


A) For intCount = 0 to strStudentName.Length - 1 outputFile.Write(strStudentName(intCount)
OutputFile.Write(", ")
OutputFile.Write(intID(intCount) )
OutputFile.Write(", ")
OutputFile.WriteLine(strMajor(intCount) )
Next intCount
B) For intCount =0 to strStudentName.Length - 1 outputFile.WriteLine(strStudentName(intCount) & ", ")
OutputFile.WriteLine(intID(intCount) & ", ")
OutputFile.WriteLine(strMajor(intCount) )
Next intCount
C) For intCount = 0 to strStudentName.Length - 1 outputFile.Write(strStudentName(intCount) )
OutputFile.Write(", ")
OutputFile.Write(intID(intCount) )
OutputFile.Write(", ")
OutputFile.Write(strMajor(intCount) )
Next intCount
D) For intCount = 1 to strStudentName.Length outputFile.Write(strStudentName(intCount)
OutputFile.Write(", ")
OutputFile.Write(intID(intCount) )
OutputFile.Write(", ")
OutputFile.Write(strMajor(intCount) )
Next intCount

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions