Functions: greeting + farewell Learn programming Visual Basic (VB.net)

Lesson:

Functions


Exercise:

Functions: greeting + farewell


Objetive:

Create a program whose Main must be like this:

public static void Main()
{
SayHello();
SayGoodbye();
}

SayHello and SayGoodbye are functions that you must define and that will be called from inside Main.


Code:

Imports System
Public Class exercise97
    Public Shared Sub SayHello()
        Console.WriteLine("Hello!")
    End Sub

    Public Shared Sub SayGoodbye()
        Console.WriteLine("Good Bye!")
    End Sub

    Public Shared Sub Main()
        SayHello()
        SayGoodbye()
    End Sub
End Class

Juan A. Ripoll - Systems Tutorials and Programming Courses ©  All rights reserved.  Legal Conditions.