Mesran

Hanya ingin berbagi kebaikan dan mendapatkan kebaikan yang lain.

Jawaban UTS Pemrograman Visual

Nah ini dia jawaban UTS Pemrograman Visual dengan saya.

Public Class Form1

	Private Sub BtnKeluar_Click(ByVal sender As System.Object, ByVal e As 	System.EventArgs) Handles BtnKeluar.Click
		End
	End Sub

	Private Sub btnHapus_Click(ByVal sender As System.Object, ByVal e As 	System.EventArgs) Handles btnHapus.Click
		Nama.Text = “”
		Tahun.Text = “”
		Tipe.Text = “”
		Harga.Text = “”
		Jumlah.Text = “”
		Merk.Text = “”
		Total.Text = “”
	End Sub

	Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) 	Handles MyBase.Load
		For xtahun = 2008 To 2011
			Tahun.Items.Add(xtahun)
		Next

		Tipe.Items.Add(“N70″)
		Tipe.Items.Add(“N73″)
		Tipe.Items.Add(“N95″)
		Tipe.Items.Add(“C51″)
	End Sub
	Sub CheckHargaHP()
		Select Case Microsoft.VisualBasic.Left(Tipe.Text, 1)
		Case “N” : Merk.Text = “NOKIA”
		Case “C” : Merk.Text = “SIEMEN”
		End Select
		
		Harga.Text = 0
		If Tahun.Text = “2008″ Then
			If Tipe.Text = “N70″ Then
				Harga.Text = 2100000
			ElseIf Tipe.Text = “N73″ Then
				Harga.Text = 2400000
			ElseIf Tipe.Text = “N95″ Then
				Harga.Text = 4100000
			ElseIf Tipe.Text = “C51″ Then
				Harga.Text = 2200000
			End If
		ElseIf Tahun.Text = “2009″ Then
			If Tipe.Text = “N70″ Then
				Harga.Text = 1950000
			ElseIf Tipe.Text = “N73″ Then
				Harga.Text = 2300000
			ElseIf Tipe.Text = “N95″ Then
				Harga.Text = 4000000
			ElseIf Tipe.Text = “C51″ Then
				Harga.Text = 2100000
			End If
		ElseIf Tahun.Text = “2010″ Then
			If Tipe.Text = “N70″ Then
				Harga.Text = 1800000
			ElseIf Tipe.Text = “N73″ Then
				Harga.Text = 2000000
			ElseIf Tipe.Text = “N95″ Then
				Harga.Text = 3900000
			ElseIf Tipe.Text = “C51″ Then
				Harga.Text = 1800000
			End If
		ElseIf Tahun.Text = “2011″ Then
			If Tipe.Text = “N70″ Then
				Harga.Text = 1600000
			ElseIf Tipe.Text = “N73″ Then
				Harga.Text = 1900000
			ElseIf Tipe.Text = “N95″ Then
				Harga.Text = 3700000
			ElseIf Tipe.Text = “C51″ Then
				Harga.Text = 1600000
			End If
		End If
	End Sub

	Private Sub Tipe_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As 	System.EventArgs) Handles Tipe.SelectedIndexChanged
		Call CheckHargaHP()
	End Sub

	Private Sub Tahun_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As 	System.EventArgs) Handles Tahun.SelectedIndexChanged
		Call CheckHargaHP()
	End Sub

	Private Sub Jumlah_KeyPress(ByVal sender As Object, ByVal e As 	System.Windows.Forms.KeyPressEventArgs) Handles Jumlah.KeyPress
		If e.KeyChar = Chr(13) Then
			Total.Text = Harga.Text * Jumlah.Text
		End If
	End Sub

End Class

Design form seperti berikut ini :

Selamat mengerjakan

Filed under: Ujian, VS2008, ,

5 Responses

  1. If you’re serious about making money with your website, watch this free video about getting free instant targeted traffic to your site http://instanttrafficrobot2.com

  2. makmur says:

    dah lama tu pak….di post kan???

  3. darmawati says:

    waduh pak penulisan harga saya yang salah
    2,1 yang ditabel itu artinya 2100000 ya pak
    saya ta maksudnya bgitu, tapi saya tidak tau dilist harganya dirubah lagi
    jadi, 2,1 4,2 3,1 saya tulis langsung aja …..
    sepertinya saya terlalu polos pak 😀

Terima kasih telah memberikan komentar anda.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archives Per Tahun

Sponsored

C&C Online Shop

Blog Stats

  • 356,504 sejak 12 Jan 2011

User’s Online


My Music

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 223 other followers

December 2011
M T W T F S S
« Nov   Jan »
 1234
567891011
12131415161718
19202122232425
262728293031  
%d bloggers like this: