
' Fig. 3.10: Addition.vb
' Addition program.

Module modAddition

    Sub Main()

        ' variables for storing user input
        Dim firstNumber, secondNumber As String

        ' variables used in addition calculation
        Dim number1, number2, sumOfNumbers As Integer

        ' read first number from user
        Console.Write("Please enter the first integer: ")
        firstNumber = Console.ReadLine()

        ' read second number from user
        Console.Write("Please enter the second integer: ")
        secondNumber = Console.ReadLine()

        ' convert input values to Integers
        number1 = firstNumber
        number2 = secondNumber

        sumOfNumbers = number1 + number2 ' add numbers

        ' display results
        Console.WriteLine("The sum is {0}", sumOfNumbers)

    End Sub ' Main

End Module ' modAddition
