Minggu, 08 Desember 2013

Quis PDAM











Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        kp.Items.Add("PAB-MED-100")
        kp.Items.Add("TOK-BEL-101")
        kp.Items.Add("SWA-MED-102")

    End Sub

    Private Sub jp_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles jp.KeyPress
        If Asc(e.KeyChar) = 13 Then
            T_tagihan.Text = Val(B_beban.Text) + (hargam3.Text * jp.Text)
            pajak.Text = 0.01 * T_tagihan.Text
            pembayaran.Text = Val(T_tagihan.Text) + Val(pajak.Text)
        End If
    End Sub

    Private Sub kp_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kp.SelectedIndexChanged
        Dim x As String
        x = Microsoft.VisualBasic.Right(kp.Text, 3)
        Select Case x
            Case "100" : nama.Text = "ucok"
            Case "101" : nama.Text = "jhan F"
            Case "102" : nama.Text = "Erin"
        End Select
        x = Microsoft.VisualBasic.Left(kp.Text, 3)
        Select Case x
            Case "TOK"
                hargam3.Text = 250
                B_beban.Text = 15000
                tipe.Text = "TOKO"
            Case "ROM"
                hargam3.Text = 150
                B_beban.Text = 10000
                tipe.Text = "RUMAH"
            Case "PAB"
                hargam3.Text = 25000
                B_beban.Text = 250000
                tipe.Text = "PABRIK"
            Case "SWA"
                hargam3.Text = 20000
                B_beban.Text = 60000
                tipe.Text = "SWALAYAN"
        End Select
        x = Microsoft.VisualBasic.Mid(kp.Text, 5, 3)
        Select Case x
            Case "MED" : daerah.Text = "MEDAN"
            Case "BEL" : daerah.Text = "BELAWAN"
            Case Else : daerah.Text = "-"
        End Select
    End Sub

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

    Private Sub ButtonHPUS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonHPUS.Click
        kp.Text = ""
        nama.Text = ""
        tipe.Text = ""
        daerah.Text = ""
        hargam3.Text = ""
        B_beban.Text = ""
        jp.Text = ""
        T_tagihan.Text = ""
        pajak.Text = ""
        pembayaran.Text = ""
    End Sub
End Class


Selasa, 18 Juni 2013

Menampilkan informasi penjualan dengan bahasa C




Kopi paste svript dibawah ini di program turbo c anda :

#include "stdio.h"
#include "conio.h"
void main(){
     int i, kode[5], jumlah[5], jumdata=5;
     char * produk ;
     float diskon,harga,tohar,bayar;

     printf ("\n Input Data Penjualan") ;
     for(i=0 ; i<jumdata ; i++ ){
          printf ( "\nKode Produk   : " ) ; scanf("%d", &kode[i]) ;
          printf ( "Jumlah Produk : ") ; scanf("%d", &jumlah[i]) ;
     }
     clrscr() ;
     printf ("\n Informasi Penjualan Produk") ;
     printf ("\n----------------------------------------------------------------------------") ;
     printf ("\n No  Kode    Produk               Harga Jumlah Total     Diskon   Pembayaran") ;
     printf ("\n----------------------------------------------------------------------------") ;
     for(i=0 ; i<jumdata ; i++ ){
          if(kode[i]==1){
                produk = "TV" ; harga = 2000000 ;
          }else if(kode[i]==2){
                produk = "DVD" ; harga = 650000 ;
          }else if(kode[i]==3){
                produk = "CD ROOM" ; harga = 450000 ;
          }

          gotoxy(1,6+i) ; printf("  %i   %d     %s", i+1, kode[i], produk) ;
          gotoxy(30,6+i) ; printf("%10.0f    %i %10.0f", harga, jumlah[i], tohar) ;
          tohar = harga * jumlah[i] ;
          if (tohar>=4000000)
          diskon=0.2*tohar;
             else if (tohar <4000000 && tohar>=2000000)
          diskon=0.15*tohar;
          else if (tohar <2000000 && tohar>=1000000)
          diskon=0.1*tohar;
          else
          diskon=0;
          bayar=tohar-diskon;
          gotoxy(54,6+i) ; printf("%10.0f", diskon) ;
          gotoxy(65,6+i) ; printf("%10.0f", bayar) ;

     }
     printf ("\n---------------------------------------------------------------------------") ;


}


lalu jhalankan  dengan menekan tombol Ctrl + F9

sehingga muncul tampilan seperti dibawah ini...





















input kode produk dan jumlah produk yang ingin anda beli...
setelah itu maka akan muncul tampilan informasi dari penjualan yang anda inputkan seperti gambar dibawah ini :


       

Kamis, 06 Juni 2013

Yuk! Belajar Konsep Pemrograman Di Mesran.Blogspot.Com


http://mesran.blogspot.com/2013/06/buatlah-program-untuk-menampilkan-hasil_2.html

Buatlah program untuk menampilkan hasil berikut dengan menggunakan perulangan :

Input Nilai : 5



#include "conio.h"
#include "stdio.h"

main()
{
int j, totalj=0

clrscr();
for(j=1 ;j<=5 ;j++){
totalj+= j;
}
printf("\n jumlah seluruh bilangan yaitu=%d",totalj);
}

Hasil : 15 = 5 + 4 + 3 + 2 + 1

Demikilahlah postingan saya Nama : (Ardiansyah Putra) NPM : (12110374)
Selamat Belajar Bahasa Pemrograman