You are on page 1of 1

SUB PROCEDURES

Using sub procedures create a program that will asked the user to select
between japan or korea. After selecting the user will be asked how many
passengers (4, 5, 6) will be going, then the total price will be displayed
Module Module1
Sub Main()
Dim Place, P, n As Integer
Dim japan, korea As String
Console.Write("Select order 1-japan or 2-korea: ")
place = Console.ReadLine
If place = 1 Then
Console.Write("how many passenger 4, 5 , 6: ")
japan = Console.ReadLine
If japan = "4" Then
P = 50 000
One(P)
End If
If japan = "5" Then
P = 80 000
One(P)
End If
If japan = "6" Then
P = 100 000
One(P)
End If
ElseIf Place = 2 Then
Console.Write("how many passenger 4, 5 , 6: ")
korea = Console.ReadLine
If korea = "4" Then
P = 90 000
One(P)
End If
If korea = "5" Then
P = 100 000
One(P)
End If
If korea = "6" Then
P = 150 000
One(P)
End If
End If
End Sub
Sub One(ByVal price As Integer)
Dim number, total As Integer
Console.Write("Enter number of passengers: ")
number = Console.ReadLine
total = price * number
Console.WriteLine("Your total passengers is: {0}", total)
End Sub
End Module

FUNCTION PROCEDURE

You might also like