87.6k views
2 votes
Write a VB program that asks the user to enter their surname. It will then tell them that they have a long surname if the name they enter has more than ten characters; otherwise, it will tell them that they don’t have a long surname​

1 Answer

5 votes

Answer:

Sure, there's a VB program that does what you're asking for:

Module Module1

Sub Main()

Dim surname As String

Console.WriteLine("Please enter your surname:")

surname = Console.ReadLine()

If surname.Length > 10 Then

Console.WriteLine("You have a long surname.")

Else

Console.WriteLine("You don't have a long surname.")

End If

Console.ReadKey()

End Sub

End Module

When you run this program, it will prompt the user to enter their surname. It will then check the length of the surname and print out either "You have a long surname" or "You don't have a long surname" based on the input size. The program waits for the user to press a key before exiting.

Step-by-step explanation:

User FrankkieNL
by
7.5k points

Related questions

1 answer
1 vote
160k views
asked Jul 8, 2024 135k views
Patrick Magee asked Jul 8, 2024
by Patrick Magee
7.6k points
1 answer
1 vote
135k views
asked Nov 4, 2024 20.9k views
Demokritos asked Nov 4, 2024
by Demokritos
8.5k points
1 answer
4 votes
20.9k views