SlideShare una empresa de Scribd logo
1 de 5
Descargar para leer sin conexión
Laporan Tugas Mata Kuliah PBO

DISUSUN
OLEH
HELMITA PUTRI (1123081)
D3 TI 2C

POLITEKNIK POS INDONESIA
DIPLOMA III
2013
Form1
Public Class Form1
Dim objMenumakanan As New ClsMenumakanan("D: PR Menu.txt")
Public Sub New()
InitializeComponent()
txtmakanan.Text = objMenumakanan.Makanan
txtharga.Text = objMenumakanan.Harga
txtjumlah.Text = objMenumakanan.Jumlah
End Sub
Private Sub btntambah_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btntambah.Click
objMenumakanan.Makanan = txtmakanan.Text()
objMenumakanan.Harga = txtharga.Text()
objMenumakanan.Jumlah = txtjumlah.Text()
If objMenumakanan.isValid Then
objMenumakanan.Cetak()
bersihIsian()
MessageBox.Show("Data sudah ditambah", "PR Menu")
End If
Dim tampil As Integer = FreeFile()
FileOpen(tampil, "D: PR Menu.txt", OpenMode.Input)
RichTextBox1.Text = InputString(tampil, LOF(tampil))
FileClose(tampil)
End Sub
Private Sub bersihIsian()
With objMenumakanan
.Bersih()
txtmakanan.Text = .Makanan
txtharga.Text = .Harga
txtjumlah.Text = .Jumlah
End With
End Sub
Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtharga.KeyPress
If Not ((e.KeyChar >= "0") And (e.KeyChar <= "9") Or
e.KeyChar = vbBack) Then
e.Handled = True
End If
End Sub

End Class

ClsMenumakanan.vb
Public Class ClsMenumakanan
Private m_Makanan As String
Private m_Harga As Single
Private m_Jumlah As Single
Private m_outputfile As String
Private outputFile As System.IO.StreamWriter
Public Sub New(ByVal value As String)
m_Makanan = "Masukkan menu makanan"
m_Harga = 0
m_Jumlah = 0
m_outputfile = value
End Sub
Public Property Makanan() As String
Get
Return m_Makanan
End Get
Set(ByVal value As String)
If value <> "" And value <> "Masukkan menu makanan" Then
m_Makanan = value
Else
MessageBox.Show("Masukkan Makanan yang benar", "Makanan")
End If
End Set
End Property
Public Property Harga() As Single
Get
Return m_Harga
End Get
Set(ByVal value As Single)
If value > 5000 Then
m_Harga = value
Else
MessageBox.Show("Masukkan di atas 5000", "Harga")
End If
End Set
End Property
Public Property Jumlah() As Integer
Get
Return m_Jumlah
End Get
Set(ByVal value As Integer)
If value > 0 Then
m_Jumlah = value
Else
MessageBox.Show("Masukkan di atas 0", "Jumlah")
End If
End Set
End Property

Public Sub Bersih()
m_Makanan = ""
m_Harga = 0
m_Jumlah = 0
End Sub
Function isValid() As Boolean
If m_Makanan <> "" And m_Makanan <> "Masukkan menu makanan" And m_Harga > 5000
Then
Return True
Else
Return False
End If
End Function
Function SubTotal() As Single
Return Harga * m_Jumlah
End Function
Function PPN() As Single
Return SubTotal() / 10%
End Function
Function Total() As Single
Return SubTotal() + PPN()
End Function
Public Sub Cetak()
outputFile = System.IO.File.AppendText(m_outputfile)
outputFile.WriteLine("Makanan : " & m_Makanan)
outputFile.WriteLine("Harga : " & m_Harga)
outputFile.WriteLine("Jumlah : " & m_Jumlah)
outputFile.WriteLine("subtotal : " & subtotal)
outputFile.WriteLine("PPN : " & PPN())
outputFile.WriteLine("Total : " & Total())
outputFile.WriteLine("_____________________________________________")
outputFile.Close()
End Sub
End Class

Form1.vb (design)
Hasil

Más contenido relacionado

La actualidad más candente

레진코믹스가 코틀린으로 간 까닭은?
레진코믹스가 코틀린으로 간 까닭은?레진코믹스가 코틀린으로 간 까닭은?
레진코믹스가 코틀린으로 간 까닭은?Taeho Kim
 
(안드로이드 개발자를 위한) 오픈소스 라이브러리 사용 가이드
(안드로이드 개발자를 위한) 오픈소스 라이브러리 사용 가이드(안드로이드 개발자를 위한) 오픈소스 라이브러리 사용 가이드
(안드로이드 개발자를 위한) 오픈소스 라이브러리 사용 가이드Taeho Kim
 
Jython: Python para la plataforma Java (JRSL 09)
Jython: Python para la plataforma Java (JRSL 09)Jython: Python para la plataforma Java (JRSL 09)
Jython: Python para la plataforma Java (JRSL 09)Leonardo Soto
 
Reactive programming in clojure script using reactjs wrappers
Reactive programming in clojure script using reactjs wrappersReactive programming in clojure script using reactjs wrappers
Reactive programming in clojure script using reactjs wrappersKonrad Szydlo
 
Jython: Python para la plataforma Java (EL2009)
Jython: Python para la plataforma Java (EL2009)Jython: Python para la plataforma Java (EL2009)
Jython: Python para la plataforma Java (EL2009)Leonardo Soto
 
Manage catalog Configueation In Sharepoint PowerShell
Manage catalog Configueation In Sharepoint PowerShellManage catalog Configueation In Sharepoint PowerShell
Manage catalog Configueation In Sharepoint PowerShellChitexe Marcos Maniche
 
Engaging users with live tiles and notifications
Engaging users with live tiles and notificationsEngaging users with live tiles and notifications
Engaging users with live tiles and notificationsAlex Golesh
 
Clojure introduction by Jason Basanese
Clojure introduction by Jason BasaneseClojure introduction by Jason Basanese
Clojure introduction by Jason BasaneseJason Basanese
 
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with EclipseEclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with EclipseHeiko Behrens
 
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Webbeyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
beyond tellerrand: Mobile Apps with JavaScript – There's More Than WebHeiko Behrens
 
MDSD for iPhone and Android
MDSD for iPhone and AndroidMDSD for iPhone and Android
MDSD for iPhone and AndroidHeiko Behrens
 
User variable and room variable
User variable and room variableUser variable and room variable
User variable and room variablegueste832a8e
 
Protocol Oriented JSON Parsing in Swift
Protocol Oriented JSON Parsing in SwiftProtocol Oriented JSON Parsing in Swift
Protocol Oriented JSON Parsing in SwiftJason Larsen
 
The Ring programming language version 1.3 book - Part 34 of 88
The Ring programming language version 1.3 book - Part 34 of 88The Ring programming language version 1.3 book - Part 34 of 88
The Ring programming language version 1.3 book - Part 34 of 88Mahmoud Samir Fayed
 
TDC2016SP - Código funcional em Java: superando o hype
TDC2016SP - Código funcional em Java: superando o hypeTDC2016SP - Código funcional em Java: superando o hype
TDC2016SP - Código funcional em Java: superando o hypetdc-globalcode
 

La actualidad más candente (18)

레진코믹스가 코틀린으로 간 까닭은?
레진코믹스가 코틀린으로 간 까닭은?레진코믹스가 코틀린으로 간 까닭은?
레진코믹스가 코틀린으로 간 까닭은?
 
(안드로이드 개발자를 위한) 오픈소스 라이브러리 사용 가이드
(안드로이드 개발자를 위한) 오픈소스 라이브러리 사용 가이드(안드로이드 개발자를 위한) 오픈소스 라이브러리 사용 가이드
(안드로이드 개발자를 위한) 오픈소스 라이브러리 사용 가이드
 
Clojure functions examples
Clojure functions examplesClojure functions examples
Clojure functions examples
 
Jython: Python para la plataforma Java (JRSL 09)
Jython: Python para la plataforma Java (JRSL 09)Jython: Python para la plataforma Java (JRSL 09)
Jython: Python para la plataforma Java (JRSL 09)
 
Reactive programming in clojure script using reactjs wrappers
Reactive programming in clojure script using reactjs wrappersReactive programming in clojure script using reactjs wrappers
Reactive programming in clojure script using reactjs wrappers
 
Jython: Python para la plataforma Java (EL2009)
Jython: Python para la plataforma Java (EL2009)Jython: Python para la plataforma Java (EL2009)
Jython: Python para la plataforma Java (EL2009)
 
Manage catalog Configueation In Sharepoint PowerShell
Manage catalog Configueation In Sharepoint PowerShellManage catalog Configueation In Sharepoint PowerShell
Manage catalog Configueation In Sharepoint PowerShell
 
Engaging users with live tiles and notifications
Engaging users with live tiles and notificationsEngaging users with live tiles and notifications
Engaging users with live tiles and notifications
 
Clojure introduction by Jason Basanese
Clojure introduction by Jason BasaneseClojure introduction by Jason Basanese
Clojure introduction by Jason Basanese
 
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with EclipseEclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
 
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Webbeyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
 
MDSD for iPhone and Android
MDSD for iPhone and AndroidMDSD for iPhone and Android
MDSD for iPhone and Android
 
Functional es6
Functional es6Functional es6
Functional es6
 
Ung dung web chuong 3
Ung dung web  chuong 3Ung dung web  chuong 3
Ung dung web chuong 3
 
User variable and room variable
User variable and room variableUser variable and room variable
User variable and room variable
 
Protocol Oriented JSON Parsing in Swift
Protocol Oriented JSON Parsing in SwiftProtocol Oriented JSON Parsing in Swift
Protocol Oriented JSON Parsing in Swift
 
The Ring programming language version 1.3 book - Part 34 of 88
The Ring programming language version 1.3 book - Part 34 of 88The Ring programming language version 1.3 book - Part 34 of 88
The Ring programming language version 1.3 book - Part 34 of 88
 
TDC2016SP - Código funcional em Java: superando o hype
TDC2016SP - Código funcional em Java: superando o hypeTDC2016SP - Código funcional em Java: superando o hype
TDC2016SP - Código funcional em Java: superando o hype
 

Más de Helmita putri (9)

Disaster recovery plan
Disaster recovery planDisaster recovery plan
Disaster recovery plan
 
Ppkn
PpknPpkn
Ppkn
 
Cover
CoverCover
Cover
 
Bab iv
Bab ivBab iv
Bab iv
 
Bab iii
Bab iiiBab iii
Bab iii
 
Bab ii
Bab iiBab ii
Bab ii
 
Bab i
Bab iBab i
Bab i
 
Laporan
LaporanLaporan
Laporan
 
3 c helmitaputri_1123081_sytems_threats_and_risk
3 c helmitaputri_1123081_sytems_threats_and_risk3 c helmitaputri_1123081_sytems_threats_and_risk
3 c helmitaputri_1123081_sytems_threats_and_risk
 

Laporan tugas mata kuliah pbo yg ke 3

  • 1. Laporan Tugas Mata Kuliah PBO DISUSUN OLEH HELMITA PUTRI (1123081) D3 TI 2C POLITEKNIK POS INDONESIA DIPLOMA III 2013
  • 2. Form1 Public Class Form1 Dim objMenumakanan As New ClsMenumakanan("D: PR Menu.txt") Public Sub New() InitializeComponent() txtmakanan.Text = objMenumakanan.Makanan txtharga.Text = objMenumakanan.Harga txtjumlah.Text = objMenumakanan.Jumlah End Sub Private Sub btntambah_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btntambah.Click objMenumakanan.Makanan = txtmakanan.Text() objMenumakanan.Harga = txtharga.Text() objMenumakanan.Jumlah = txtjumlah.Text() If objMenumakanan.isValid Then objMenumakanan.Cetak() bersihIsian() MessageBox.Show("Data sudah ditambah", "PR Menu") End If Dim tampil As Integer = FreeFile() FileOpen(tampil, "D: PR Menu.txt", OpenMode.Input) RichTextBox1.Text = InputString(tampil, LOF(tampil)) FileClose(tampil) End Sub Private Sub bersihIsian() With objMenumakanan .Bersih() txtmakanan.Text = .Makanan txtharga.Text = .Harga txtjumlah.Text = .Jumlah End With End Sub Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtharga.KeyPress If Not ((e.KeyChar >= "0") And (e.KeyChar <= "9") Or e.KeyChar = vbBack) Then e.Handled = True End If End Sub End Class ClsMenumakanan.vb
  • 3. Public Class ClsMenumakanan Private m_Makanan As String Private m_Harga As Single Private m_Jumlah As Single Private m_outputfile As String Private outputFile As System.IO.StreamWriter Public Sub New(ByVal value As String) m_Makanan = "Masukkan menu makanan" m_Harga = 0 m_Jumlah = 0 m_outputfile = value End Sub Public Property Makanan() As String Get Return m_Makanan End Get Set(ByVal value As String) If value <> "" And value <> "Masukkan menu makanan" Then m_Makanan = value Else MessageBox.Show("Masukkan Makanan yang benar", "Makanan") End If End Set End Property Public Property Harga() As Single Get Return m_Harga End Get Set(ByVal value As Single) If value > 5000 Then m_Harga = value Else MessageBox.Show("Masukkan di atas 5000", "Harga") End If End Set End Property Public Property Jumlah() As Integer Get Return m_Jumlah End Get Set(ByVal value As Integer) If value > 0 Then m_Jumlah = value Else MessageBox.Show("Masukkan di atas 0", "Jumlah") End If End Set End Property Public Sub Bersih() m_Makanan = "" m_Harga = 0 m_Jumlah = 0
  • 4. End Sub Function isValid() As Boolean If m_Makanan <> "" And m_Makanan <> "Masukkan menu makanan" And m_Harga > 5000 Then Return True Else Return False End If End Function Function SubTotal() As Single Return Harga * m_Jumlah End Function Function PPN() As Single Return SubTotal() / 10% End Function Function Total() As Single Return SubTotal() + PPN() End Function Public Sub Cetak() outputFile = System.IO.File.AppendText(m_outputfile) outputFile.WriteLine("Makanan : " & m_Makanan) outputFile.WriteLine("Harga : " & m_Harga) outputFile.WriteLine("Jumlah : " & m_Jumlah) outputFile.WriteLine("subtotal : " & subtotal) outputFile.WriteLine("PPN : " & PPN()) outputFile.WriteLine("Total : " & Total()) outputFile.WriteLine("_____________________________________________") outputFile.Close() End Sub End Class Form1.vb (design)