8. create a console application. Insert the below code, and run the program. Note that a conditional statement is used within the body of the loop. This is common. Write a similar program using this one as an example that asks the user to name his or her favorite make of automobile. If the user fails to guess, provide feedback that includes a hint, e.g. “Hint: This make of your car is made in Germany”.

Module Module1

    Sub Main()
        Dim BMW As String
        Dim guess As String = ""
        Do Until guess = BMW
            Console.WriteLine("Name your favorite make of automobile")
            guess = Console.ReadLine()
            If guess != BMW Then
                Console.WriteLine("Sorry wrong answer hint: This make of car is made in Germany.")
                Console.WriteLine()
            End If
        Loop
        Console.WriteLine("Congratulations you guessed the right automobile!")
        Console.WriteLine()
        Console.WriteLine("Press [Enter] key to continue")
        Console.ReadLine()

    End Sub

End Module

error
identifier expected If guess != BMW Then
^

try this:

Dim guess As String = ""
		Do Until guess = "BMW"
			Console.WriteLine("Name your favorite make of automobile")
			guess = Console.ReadLine()
			If guess <> "BMW" Then
				Console.WriteLine("Sorry wrong answer hint: This make of car is made in Germany.")
				Console.WriteLine()
			End If
		Loop

You're welcome and i'm glad you got it working.

Please mark this thread as solved if you have found a solution to your question and good luck!

This question has already been answered. Start a new discussion instead.