Advertisement
Guest User

Untitled

a guest
Feb 2nd, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.79 KB | None | 0 0
  1. Module Module1
  2. Structure pupil
  3. Dim firstname As String
  4. Dim surname As String
  5. Dim year As String
  6. End Structure
  7. Structure Staff
  8. Dim username As String
  9. Dim password As String
  10. End Structure
  11. Structure Questions
  12. Dim question0 As String
  13. Dim question1 As String
  14. Dim question2 As String
  15. Dim question3 As String
  16. Dim question4 As String
  17. Dim question5 As String
  18. Dim question6 As String
  19. Dim question7 As String
  20. Dim question8 As String
  21. Dim question9 As String
  22. End Structure
  23. Dim students(100) As pupil
  24. Dim teachers(50) As Staff
  25. Dim question(10) As Questions
  26. Dim recordnum As Integer
  27. Dim numofrecords As Integer
  28.  
  29. Sub Main()
  30. Login()
  31. End Sub
  32. Private Sub Login()
  33. Console.WriteLine("Login Below Please")
  34. Console.Write("Username: ")
  35. Dim username As String = Console.ReadLine()
  36. Dim password As String = Console.ReadLine()
  37.  
  38. If username.StartsWith("3") Then
  39. Dim filereader As String
  40. filereader = My.Computer.FileSystem.ReadAllText("C:\Users\Joshu\Onedrive\Year3.csv")
  41. Console.WriteLine("Hello " + username + " welcome to the year 3 test")
  42. Console.WriteLine(filereader)
  43. Dim answer As String = Console.ReadLine()
  44. Console.WriteLine("Answer 1: ")
  45. Console.WriteLine("Answer 2: ")
  46. Console.WriteLine("Answer 3: ")
  47. Console.WriteLine("Answer 4: ")
  48. Console.WriteLine("Answer 5: ")
  49. Console.WriteLine("Answer 6: ")
  50. Console.WriteLine("Answer 7: ")
  51. Console.WriteLine("Answer 8: ")
  52. Console.WriteLine("Answer 9: ")
  53. Console.WriteLine("Answer 10: ")
  54. End If
  55. If username.StartsWith("4") Then
  56. 'Y4Test()
  57. End If
  58. If username.StartsWith("5") Then
  59. 'Y5Test()
  60. End If
  61. If username.StartsWith("6") Then
  62. 'Y6Test()
  63. End If
  64. If username.StartsWith("1") Then
  65. Console.Write("Password: ")
  66. 'TMenu()
  67. End If
  68. Console.ReadLine()
  69. End Sub
  70. Private Sub Y3Test()
  71. recordnum = -1
  72. numofrecords = -1
  73.  
  74. FileOpen(1, "C:\Users\Joshu\OneDrive\Documents\Year3.csv", OpenMode.Input)
  75. Do Until EOF(1)
  76. Dim printline As String = LineInput(1)
  77. recordnum += 1
  78. Dim defin() As String = Split(printline, ",")
  79. With question(recordnum)
  80. .question0 = defin(0)
  81. .question1 = defin(1)
  82. .question2 = defin(2)
  83. .question3 = defin(3)
  84. .question4 = defin(4)
  85. .question5 = defin(5)
  86. .question6 = defin(6)
  87. .question7 = defin(7)
  88. .question8 = defin(8)
  89. .question9 = defin(9)
  90. End With
  91. Loop
  92. FileClose(1)
  93. numofrecords = recordnum + 1
  94. recordnum = 0
  95. End Sub
  96. Sub Y3testt()
  97. Dim filereader As String
  98. filereader = My.Computer.FileSystem.ReadAllText("C:\Users\Joshu\Onedrive\Year3.csv")
  99. ' Console.WriteLine("Hello " + username + "welcome to the year 3 test")
  100. Console.WriteLine(filereader)
  101. Dim answer As String = Console.ReadLine()
  102. Console.Write("Answer 1: ")
  103. Console.Write("Answer 2: ")
  104. Console.Write("Answer 3: ")
  105. Console.Write("Answer 4: ")
  106. Console.Write("Answer 5: ")
  107. Console.Write("Answer 6: ")
  108. Console.Write("Answer 7: ")
  109. Console.Write("Answer 8: ")
  110. Console.Write("Answer 9: ")
  111. Console.Write("Answer 10: ")
  112. End Sub
  113. End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement