Headlines News :
Selamat Datang di blog Hidayat Ahmoed
Home » » Program Diskon Beli

Program Diskon Beli

Written By Unknown on Sabtu, 07 Desember 2013 | 03.02

desain form seperti gambar di bawah ini..............


Ketentuan

mendeklarasikan (memperkenlakan) 
variabel mdis dengan tipe data double
kemudian menhitung jumlah beli, jika jumlah beli (TextBox3) 
di atas 20000 maka akan mendapatkan diskon 10% 
sebaliknya tidak mendapatkan, kemudian untuk
menghitung bayar dari jumlah beli di kurang diskon.

Coding Program
Public Class Form1

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Me.Close()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox4.Text = ""
        TextBox5.Text = ""
        TextBox1.Focus()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim mdis As Double
        TextBox3.Text = Val(TextBox1.Text) * Val(TextBox2.Text)
        If TextBox3.Text > 20000 Then
            mdis = TextBox3.Text * 0.01
        Else
            mdis = TextBox3.Text * 0
        End If
        TextBox4.Text = mdis
        TextBox5.Text = TextBox3.Text - TextBox4.Text


    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        TextBox3.Enabled = False
        TextBox4.Enabled = False
        TextBox5.Enabled = False

    End Sub
End Clas
s
Share this article :

0 komentar:

Speak up your mind

Tell us what you're thinking... !

efek daun

Translate

Blogger templates

Flag Counter
 
Support : Creating Website | Hidayat Ahmoed | Mas Template
Proudly powered by Blogger
Copyright © 2011. Blog_ahmoed - All Rights Reserved
Template Design by Creating Website Published by Ahmoed