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

Rainfire

Honorable
Jan 20, 2014
3
0
10,510
0
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.

 
Thread starter Similar threads Forum Replies Date
T Apps General Discussion 5
A Apps General Discussion 2
S Apps General Discussion 1
M Apps General Discussion 0
M Apps General Discussion 0
R Apps General Discussion 0
M Apps General Discussion 1
S Apps General Discussion 1
T Apps General Discussion 10
T Apps General Discussion 2
H Apps General Discussion 1
B Apps General Discussion 2
L Apps General Discussion 1
N Apps General Discussion 5
T Apps General Discussion 1
N Apps General Discussion 3
M Apps General Discussion 3
P Apps General Discussion 2
appletatoes Apps General Discussion 3
M Apps General Discussion 1

ASK THE COMMUNITY