The correct answers were B C T F F
Dave got 4 right
Bert got 3 right
Carl got 2 right
Alex got 1 right
Eddy got 0 right
The following program found this as the only result in which no two students got the same number of correct answers.
Imports System
Imports System.IO
Imports System.Text
Imports System.Runtime.InteropServices
Imports System.Math
Module Module1
Sub Main()
Randomize()
Dim strstarttime As String
Dim strendtime As String
Dim strend As String
Dim intquiz(72, 10) As Integer
Dim intanswers(5, 5) As Integer
Dim intloop1 As Integer = 71
Dim intloop2 As Integer = 9
Dim intsub1 As Integer
Dim intmatches As Integer
Dim strstring As String
strstarttime = TimeOfDay
Console.WriteLine("Start of execution: " & strstarttime)
For index1 As Integer = 0 To intloop1
For index2 As Integer = 0 To intloop2
intquiz(index1, index2) = 0
Next
Next
intanswers(0, 0) = 0
intanswers(0, 1) = 0
intanswers(0, 2) = 1
intanswers(0, 3) = 1
intanswers(0, 4) = 1
intanswers(1, 0) = 1
intanswers(1, 1) = 1
intanswers(1, 2) = 1
intanswers(1, 3) = 0
intanswers(1, 4) = 1
intanswers(2, 0) = 0
intanswers(2, 1) = 1
intanswers(2, 2) = 1
intanswers(2, 3) = 1
intanswers(2, 4) = 0
intanswers(3, 0) = 1
intanswers(3, 1) = 2
intanswers(3, 2) = 1
intanswers(3, 3) = 1
intanswers(3, 4) = 0
intanswers(4, 0) = 2
intanswers(4, 1) = 0
intanswers(4, 2) = 0
intanswers(4, 3) = 1
intanswers(4, 4) = 1
intsub1 = 0
For indexq1 As Integer = 0 To 2
For indexq2 As Integer = 0 To 2
For indexq3 As Integer = 0 To 1
For indexq4 As Integer = 0 To 1
For indexq5 As Integer = 0 To 1
testquiz(intquiz, intanswers, _
indexq1, indexq2, indexq3, _
indexq4, indexq5, _
intsub1)
Next
Next
Next
Next
Next
For index1 As Integer = 0 To intloop1
intmatches = 0
For index2 As Integer = 5 To intloop2 - 1
For index3 As Integer = index2 + 1 To intloop2
If intquiz(index1, index2) = _
intquiz(index1, index3) Then
intmatches += 1
End If
Next
Next
If intmatches = 0 Then
strstring = ""
For index2 As Integer = 0 To intloop2
If index2 < 2 Then
Select Case intquiz(index1, index2)
Case 0
strstring &= "A"
Case 1
strstring &= "B"
Case 2
strstring &= "C"
End Select
ElseIf index2 < 5 Then
Select Case intquiz(index1, index2)
Case 0
strstring &= "F"
Case 1
strstring &= "T"
End Select
Else
strstring &= Str(intquiz(index1, index2))
End If
strstring &= " "
Next
Console.WriteLine("ANSWER: " & strstring)
End If
Next
strendtime = TimeOfDay
Console.WriteLine(" ")
Console.WriteLine("Start of execution: " & strstarttime)
strendtime = TimeOfDay
Console.WriteLine("End of execution: " & strendtime)
strend = "?"
Console.WriteLine(" ")
While strend <> "X"
Console.WriteLine("Please enter X to exit program...")
strend = UCase(Console.ReadLine())
End While
End Sub
Sub testquiz(ByRef intquiz, ByRef intanswers, _
ByRef indexq1, ByRef indexq2, ByRef indexq3, _
ByRef indexq4, ByRef indexq5, _
ByRef intsub1)
intquiz(intsub1, 0) = indexq1
intquiz(intsub1, 1) = indexq2
intquiz(intsub1, 2) = indexq3
intquiz(intsub1, 3) = indexq4
intquiz(intsub1, 4) = indexq5
For index1 As Integer = 0 To 4
For index2 As Integer = 0 To 4
If intanswers(index1, index2) = _
intquiz(intsub1, index2) Then
intquiz(intsub1, index1 + 5) += 1
End If
Next
Next
intsub1 += 1
End Sub
End Module