Guest User

Untitled

a guest
Jun 16th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Module Module1
  2.     ' variables declared. Declared them as "nothing" to avoid an error if the user entered nothing
  3.    Sub Main()
  4.         Dim user As String = Nothing
  5.         Dim pass As String = Nothing
  6.         Dim begin As String = Nothing
  7.         Dim game As String = Nothing
  8.  
  9.         ' Initial console output. Simple name and password request.
  10.        Console.WriteLine("Enter your name")
  11.         user = Console.ReadLine()
  12.             Console.WriteLine("Enter your password")
  13.         pass = Console.ReadLine()
  14.  
  15.         ' Simple if else statement. If user = me, or my (ex gf...) AND pass is correct then
  16.        ' proceed. Else end the program. Not sure if thats what "return does in vb'
  17.  
  18.         If (user = "Sarah" Or user = "Roy") And pass = "buttercup" Then
  19.             Console.WriteLine("Welcome to Visual basic " & user)
  20.         Else
  21.             Console.WriteLine("That username or password is incorrect " & user)
  22.             Console.ReadLine()
  23.             Return
  24.         End If
  25.  
  26.         ' How to convert the users input to lowercase and just do the one check instead of
  27.        ' yes OR Yes??
  28.  
  29.         Console.WriteLine("Lets begin shall we?")
  30.         begin = Console.ReadLine()
  31.         If begin = "yes" Or begin = "Yes" Then
  32.             Console.WriteLine("What shall we do first?")
  33.  
  34.             ' Not sure exactly where I'm going to go from here.
  35.            ' Thought maybe a simple math game? Been trying to sort out
  36.            ' how to record users input to a file? Perhaps a simple
  37.            ' txt file that annotates right or wrong?
  38.  
  39.             game = Console.ReadLine()
  40.         Else
  41.             Console.WriteLine("Goodbye " & user)
  42.             Console.ReadLine()
  43.             Return
  44.         End If
  45.         Console.ReadLine()
  46.  
  47.  
  48.     End Sub
  49. End Module
Add Comment
Please, Sign In to add comment