How do I make a yes or no question with different outcomes depending on input?

Rainfire

Honorable
Jan 20, 2014
3
0
10,510
I have Programming in Basic in High School and was tasked with a project in which I was to make a program that says hello to the teacher as well as give a paragraph describing why programming is valuable in today's time.

My initial idea was to make a program that greets and asks the teacher a question on whether they want to know why programming is valuable. When the console asks the question there will be two options: Yes or No. Each having their own text output.

Here's the code I have so far:
Module Module1

Sub Main()
REM Test
Dim Yes As String
Dim No As String
Console.WriteLine("Hello, Would you like to know why programming is valuable? Yes or No")
Yes = Console.ReadLine
No = Console.ReadLine
If Console.ReadLine = "Yes" Then
Console.WriteLine("Well...1")
ElseIf Console.ReadLine = "No" Then
Console.WriteLine("Well...2")
End If

End Sub

End Module

This works but I have to enter "Yes" on the console three times before the "Well...1" line pops up.

Any help would be appreciated! Thanks! :D

EDIT:I am using Visual Basic.

 

TRENDING THREADS