Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class pros_stack
- Dim stk As New Stack(Of barang)
- Private Sub beli(ByVal brg As barang)
- stk.Push(brg)
- stock += brg.jml
- End Sub
- Private Function jual() As barang
- Dim hps As barang = stk.Pop
- stock -= hps.jml
- Return hps
- End Function
- Public Sub proses()
- Dim putar As Boolean = True
- Dim pilih As Integer
- Dim new_brg As barang
- '
- Console.Clear()
- history.Clear()
- '
- Try
- Console.WriteLine(" Proses STACK")
- Console.WriteLine(" ------------")
- While putar
- Console.WriteLine(" Menu")
- Console.WriteLine(" 1. Beli")
- Console.WriteLine(" 2. Jual")
- Console.WriteLine(" 3. Selesai")
- Console.WriteLine()
- Console.Write("Pilih : ")
- pilih = Console.ReadLine
- If pilih = 1 Then ' BELI
- Console.WriteLine(" Proses Beli")
- Console.WriteLine(" ----------")
- Console.Write("Jumlah Barang : ")
- new_brg.jml = Console.ReadLine
- Console.Write("Harga Satuan : ")
- new_brg.hrg = Console.ReadLine
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement