Labels

RSS

UKM

Imports System.Windows.Forms
Imports System.Data.OleDb
Imports System.Data
Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub

Private Sub ButtonX2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX2.Click
Db_anggota1.Clear()
OleDbDataAdapter1.Fill(Db_anggota1)
End Sub

Private Sub BtnInput_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnInput.Click
Dim strCmd As OleDbCommand

Dim strSQL As String

Dim DbCmd As New OleDbCommand

Dim cnxn = New OleDbConnection(“Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\UKM\UKM\ukm_db.mdb;Persist Security Info=False;”)

strSQL = “INSERT INTO data_anggota (Nama,NIM,Jurusan,Angkatan,Jabatan,Hp) values (‘” & TextBoxNama.Text & “‘, ” & _
“‘” & TextBoxXNim.Text & “‘,’” & TextBoxXJrusan.Text & “‘,’” & TextBoxXAngkatan.Text & “‘,’” & TextBoxXJbtan.Text & “‘,” & _
“‘” & TextBoxXHp.Text & “‘);”

strCmd = New OleDbCommand(strSQL, cnxn)

cnxn.Open()

‘MsgBox(strSQL)

DbCmd = New OleDbCommand(strSQL, cnxn)

DbCmd.ExecuteNonQuery()

cnxn.Close()

End Sub

Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX1.Click

End Sub


Private Sub ButtonX3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX3.Click

hasilnya

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

jarak tempuh

#include <iostream.h>

float waktu (float vo,float vt,float n)
{
float hasil;
hasil = vt / (vo + n);
cout <<"Hasil Waktu Tempuh Perjalanan : "<<hasil;
}

int main()
{
float vo,vt,n,hasil;
cout <<"MENENTUKAN WAKTU TEMPUH KENDARAAN" << endl;
cout <<"Kecepatan Awal : ";
cin >> vo;
cout <<"Kecepatan Akhir : ";
cin >> vt;
cout <<"Masukkan Percepatan : ";
cin >> n;
hasil=waktu(vo,vt,n);
return 0;
}


hasilnya

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Mencari Kordinat

listing program

#include <iostream.h>
#include <math.h>


void panjang (int x1,int x2,int y1,int y2)
{   
    float hasil;
    if (x1==x2)
    {
        hasil =  abs(y2-y1);
    }
    else
        if (y2==y1)
    {
        hasil = abs(x2-x1);
    }
        else
    {
            hasil = sqrt((x2-x1) * (x2-x1) + (y2-y1) * (y2-y1)); // rumus pitagoras
    }
            cout << "Maka hasilnya : " <<hasil;
           
}

int main ()
{
    int a,b,c,d;
    cout << "Masukan Nilai X1 : ";
    cin >> a;
    cout << "Masukan Nilai X2 : ";
    cin >> b;
    cout << "Masukan Nilai Y1 : ";
    cin >> c;   
    cout << "Masukan Nilai Y1 : ";
    cin >> d;
   
    panjang(a,b,c,d); // pemangilan fungsi panjang
   
return 0;
}
   
Hasilnya

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Blogger news

Popular Posts