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:
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!
EDIT:I am using Visual Basic.
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
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!
EDIT:I am using Visual Basic.