Building the project in the VB.NET console
This simple console application written in VB.NET programming language performs basic arithmetic operations on two input numbers.
The program first imports the System
namespace. Then, it defines a module called program
, which contains a single Sub
called Main
that takes an array of String
arguments.
Within the Main
method, the program declares five variables: n1
, n2
, oper
of type String
, a res
of type String
initialized to an empty string, and a sentinel
of type String
initialized to False
.
The program enters a Do-While
loop until the sentinel is set to True
. Within the loop, the program prompts the user to enter the first number or X
to quit. If the user enters X
, the sentinel variable is set to True
, and the loop ends. Otherwise, the program prompts the user to enter the second number and the arithmetic operator.
The program then uses a Select Case
statement to perform the appropriate arithmetic operation based on the user’...