This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Blogroll

Minggu, 04 Juni 2017

Membuat sebuah program console application yang digunakan untuk mpembelian tiket pesawat.

  • Total Harga = jumlah penumpang x harga tiket
  • Ketentuan Harga tiket dapat dilihat pada tabel dibawah ini


Rumusnya adalah :

Sub Main()

        Dim nama, alamat, total As String
        Dim tanggal_l, tanggal_b, kod_mas, kod_rute, har_tiket, rute, jum_penum As Integer

        Console.Write("Nama Pembeli                         : ")
        nama = Console.ReadLine
        Console.Write("Alamat                               : ")
        alamat = Console.ReadLine
        Console.Write("Tanggal Lahir                        : ")
        tanggal_l = Console.ReadLine
        Console.Write("Tanggal Berangkat                    : ")
        tanggal_b = Console.ReadLine

        Console.WriteLine("Maskapai")
        Console.WriteLine("1. AirAsia")
        Console.WriteLine("2. Garuda")
        Console.WriteLine("3. LionAir")
        Console.Write("Masukkan Kode Maskapai[1/2/3]        : ")
        kod_mas = Console.ReadLine
        Console.WriteLine("Rute")
        Console.WriteLine("1. Medan-Jakarta")
        Console.WriteLine("2. Medan-Bandung")
        Console.Write("Masukkan Kode Rute                   : ")
        kod_rute = Console.ReadLine
        If kod_mas = "1" Then
            If rute = "1" Then
                har_tiket = "500,000"
            Else
                har_tiket = "600,000"
                Console.WriteLine("Harga Tiket                        : " & har_tiket)
            End If
        ElseIf kod_mas = "2" Then
            If rute = "1" Then
                har_tiket = "1,000,000"
            Else
                har_tiket = "1,500,000"
                Console.WriteLine("Harga Tiket                          : " & har_tiket)
            End If
        Else
            If rute = "1" Then
                har_tiket = "800,000"
            Else
                har_tiket = "1,200,000"
                Console.WriteLine("Harga Tiket                          : " & har_tiket)
            End If
        End If

        Console.Write("Jumlah Penumpang                     : ")
        jum_penum = Console.ReadLine
        Console.WriteLine(StrDup(50, "="))
        Console.Write("Total Harga                          : " & har_tiket * jum_penum)
        total = Console.ReadLine()
        Console.WriteLine(StrDup(50, "="))
        Console.ReadKey()

    End Sub

Silahkan copy rumus diatas ini. Terima Kasih atas kunjungannya !!