Jumat, 29 Juni 2012


hari ini saya ingin sedikit membahas tentang html (hyper text markup language), langsung aja html ini adalah bahasa yang di gunakan untuk menampilkan document web. contoh script bisa di lihat di bawah:
  1.   Html 1 - Formulir Pendaftaran
<html>
<head><title>Pendaftaran online</title>
</head>
<h1><center>Formulir Pendaftaran Online Mahasiswa Baru</center></h1>
</ol>
<h2>Isilah indentitas Lengkap anda di bawah ini</h2>
<ol>
<p><label font="Nama">Nama:</label> <input type="text"name="Nama" maxlength="100"size="45" /></p>                                                                         
<p><label font="kelas">Jenis Kelamin :  </label><select name="kelas">
<option>Laki-laki</option>
<option>Perempuan</option>
</select>
</p>

<p><label font="tanggal">Tanggal Lahir_________</label>
<label font="tgl">tanggal :  </label><select name="tgl">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>32</option>
</select>
<label font="bln">bulan :  </label><select name="bln">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>12</option>
</select>
<label font="thn">tahun :  </label><select name="thn">
<option>1991</option>
<option>1992</option>
<option>1993</option>
<option>1994</option>
<option>1995</option>
<option>1996</option>
<option>1997</option>
</select>
</p>

<p><label font="Asal">Asal Sekolah  : </label> <input type="text" name="NIM" maxlength="8"size="10" /></p> 
<p><label font="alasa">Alasan Anda Masuk UAD :</p><textarea name="comments" rows="5" cols="40"></textarea></p>
<p><label font="pengalaman">Tuliskan Pengalaman Organisasi Anda : </p><textarea name="comments" rows="5" cols="40"></textarea>

<p><input type="submit" name="btnEnroll" value="Kirim
Untuk Mendaftar" /></p>
</html>

  • GAMBAR HTML 1
 





 2.     HTML 2 – Link
<html>
<head><title>contoh link</title>
</head>
<body>
<h1>Berita Olah Raga</h1>
<p>
<a href="index.html" title="Link to the home page
  • opens in the same window">Branda</a><br />
<a href="Volly ball.html" title="Link to vollyball.html
  • opens in the same window">volly ball</a><br />
<a href="Sepak Bola.html" title="Link to Sepak Bola.html
  • opens in the same window">Sepak Bola</a><br />
<a href="Basket Ball.html" title="Link to Basket Ball.html
  • opens in the same window">Basket Ball</a><br />
<a href="Batminton.html" title="Link to Batminton.html
  • opens in the same window">Batminton</a>
<br />
</p>
</body>
</html>

  • Gambar HTML 2
 
  1. 3.     HTML 3 – Table
<html>
<head>
<title>Jadwal Kuliah</title>
</head>
<h1><center>Jadwal Kuliah</center></h1>
</ol>
<center><table border="1">
<tr>
<th>Jam</th>
<th>Senin</th>
<th>Selasa</th>
<th>Rabu</th>
<th>Kamis</th>
<th>Jum'at</th>
<th>Sabtu</th>
<th>Minggu</th>
</tr>
<tr>
<td>7:30 - 9:00</td>
<td>BasisData.T</td>
<td >Kosong </td> </b> </font face="Timer New Roman" size="4" color="blue"> </td>
<td>Alpro</td>
<td> <font face="Timer New Roman" size="4" color="blue"> <b> Kosong </b> </td> </font face="Timer New Roman" size="4" color="blue"> </td>
<td> <font face="Timer New Roman" size="4" color="blue"> <b> Kosong </b> </td> </font face="Timer New Roman" size="4" color="blue"> </td>
<td> <font face="Timer New Roman" size="4" color="blue"> <b> Kosong </b> </td> </font face="Timer New Roman" size="4" color="blue"> </td>
<td> <font face="Timer New Roman" size="4" color="red"> <b> Libur </b> </td> </font face="Timer New Roman" size="4" color="red"> </td>
</tr>
<tr>
<td>9:00 - 10:30</td>
<td> <font face="Timer New Roman" size="4" color="blue"> <b> <i> <u> Kosong </b> </i> </u>  </td> </font face="Timer New Roman" size="4" color="brown"> </td>
<td>PWeb</td>
<td> <font face="Timer New Roman" size="4" color="blue"> <b> <i> <u>  Kosong </b> </i> </u> </td> </font face="Timer New Roman" size="4" color="brown"> </td>
<td>Sertifikasi</td>
<td> <font face="Timer New Roman" size="4" color="blue"> <b> <i> <u> Kosong </b> </i> </u> </td> </font face="Timer New Roman" size="4" color="brown"> </td>
<td>PTI</td>
<td> <font face="Timer New Roman" size="4" color="red"> <b> Libur </b> </td> </font face="Timer New Roman" size="4" color="red"> </td>

</tr>
<tr>
<td>10:30 - 12:00</td>
<td>P.Web</td>
<td>Kalkulus</td>
<td>Matdis</td>
<td> <font face="Timer New Roman" size="4" color="blue"> <b> Kosong </b> </td> </font face="Timer New Roman" size="4" color="green"> </td>
<td>SistemDigital</td>
<td> <font face="Timer New Roman" size="4" color="blue"> <b> Kosong </b> </td> </font face="Timer New Roman" size="4" color="green"> </td>
<td> <font face="Timer New Roman" size="4" color="red"> <b> Libur </b> </td> </font face="Timer New Roman" size="4" color="red"> </td>

</tr>
<tr>
<td>12:00 - 1:30</td>
<td> <font face="Timer New Roman" size="4" color="blue"> <b> <i> Kosong </b> <i> </td> </font face="Timer New Roman" size="4" color="violet"> </td>
<td> <font face="Timer New Roman" size="4" color="blue"> <b> <i> Kosong </b> <i> </td> </font face="Timer New Roman" size="4" color="violet"> </td>
<td> <font face="Timer New Roman" size="4" color="blue"> <b> <i> Kosong </b> <i> </td> </font face="Timer New Roman" size="4" color="violet"> </td>
<td>Agama</td>
<td>Bhs. Ingris</td>
<td> <font face="Timer New Roman" size="4" color="blue"> <b> <i> Kosong </b> <i> </td> </font face="Timer New Roman" size="4" color="red"> </td>
<td> <font face="Timer New Roman" size="4" color="red"> <b> Libur </b> </td> </font face="Timer New Roman" size="4" color="red"> </td>

</table>
</center>

  • Gambar HTML 3 – table
 

Kamis, 31 Mei 2012

Refleksi ke-9

langsung aja..... hari ini dosen mengeluarkan setengah dari teman-teman saya, kekecewaan muncul tapi harus bagaimana, dapet pelajaran tapi sedikit nyesek....... just looking from windows,

menggabungkan 2 buah array

DALAM BENTUK C++

#include <iostream>
#include <string>

using namespace std;
int main()
{
  
   int n;
   int i;
   int j;
   int a[10];
   int b[10];
  
   cout<<"menggabungkan 2 buah array"<<endl;
   cout<<"Masukkan n = ";
   cin >> n;
   i =1;
   cout << "Array A : " << endl;   while (!(i>n))
   {
      raptor_prompt_variable_zzyz ="Input data";
      cout << "data ke ["<<i<<",1] = ";     
      cin >> a[i]; i =i+1;
   }
   cout << "......................................................." << endl;   cout << "Array B : " << endl;   j =1;
   while (!(j>n))
   {
      raptor_prompt_variable_zzyz ="Input data";
      cout << "data ke ["<<j<<",1] = ";  
      cin >> b[j];   j =j+1;
   }
   cout << "......................................................." << endl;   cout << "Matriks Dua Dimensi" << endl;   i =1;
   while (1)
   {
      j =1;
      if (i>n) break;
      while (!(j>2))
      {
         cout << "data ke ["<<i<<","<<j<<"] = "<<a[i] << endl;         j =j+1;
      }
      i =i+1;
   }

   system("pause");
   return 0;
}



DALAM BENTUK REPTOR



Rabu, 30 Mei 2012

PROGRAM GENERATE PERMUTASI

#include <stdio.h>
#include <conio.h>
#include <stdlib.h>

using namespace std;

int hasil;
//funsi faktorial :
int faktorial (int nilai)
{
hasil = nilai;
while(nilai>1)
{
hasil = hasil*(nilai-1);
nilai = nilai-1;
}
return hasil;
}
main()
{
int p,nq,max,x,i,j,n,k,r,s,tr,no ;
int a[100];
div_t xx;

for (i=0;i<100;i++)
{
a[i] =0;
}
//Tampilkan pembuka
printf("\n PROGRAM GENERATE PERMUTASI\n\n");

//input nilai n(jumlah data <maksimal 100>)
printf("Masukan nilai n : ");
scanf("%d",&n);
//input data ke dalam array
for(i=1;i<=n;i++) //ulangi untuk semua data hingga data ke-n
{
printf("Masukan nilai himpunan a[%d] : ",i);
scanf("%d",&a[i]);
}

//input nilai r
printf("nilai r : ");
scanf("%d",&tr);

//hitung nilai permutasi
p=faktorial(n);
nq=faktorial(n-tr);
if(nq==0)nq=1;
max=p/nq;

printf("nilai permutasi : %d\n\nTekan Enter untuk melihat hasil generate permutasi...\n",max);

getche();//fungsi membaca karakter keyboard
no=1;//variabel untuk menampilkan nomor

//men-generate permutasi dengan
//algoritma generate next-permutation

//genere sabanyak nilai permutasi
for(x=1;x<=max;x++)
{
printf("%3d. ",no);
for(i=1;i<=tr;i++)
printf("%d",a[i]);
printf("\n",a[i]);
no++;

j=n-1;
while(a[j] > a[j+1])
j=j-1 ; //j adalah subcript terbesar dengan aj<aj+1
k=n;
while(a[j] > a[k])
k=k-1 ; //ak adalah integer terkecil dan lebih besar dari aj

//tukar aj dan ak
i=a[k];
a[k]=a[j];
a[j]=i;

r=n;
s=j+1;
while (r>s)
{
//tukar ar dan as
i=a[r];
a[r]=a[s];
a[s]=i;

r=r-1;
s=s+1;
}
}

system("PAUSE");
return EXIT_SUCCESS;
}

OPERASI MATRIX TRANSPOSE

#include <iostream>
#include <conio.h>
#include <iomanip.h>

int b1,b2,k1,k2,baris1,baris2,kolom1,kolom2,matrik1[10][10],matrik2[10][10],hasil[10][10];
main()
{
cout<<"OPERASI MATRIX TRANSPOSE\n";
do
{
cout<<"jumlah baris : ";
cin>>baris1;
cout<<"jumlah kolom : ";
cin>>kolom1;
}
while ((baris1>10)||(kolom1>10));
cout<<"\nmatrix A"<<endl;
for(b1=0;b1<kolom1;b1++)
for(k1=0;k1<baris1;k1++)
{
cout<<"data [" <<b1<<","<<k1<<"]=";
cin>>matrik1[b1][k1];
}
for(b1=0;b1<kolom1;b1++)
{
cout<<'\n';
for(k1=0;k1<baris1;k1++)
cout<<setw(4)<<matrik1[b1][k1];
}
{
printf("\ntranspose matrik 1 : \n");
for(b1=0;b1<kolom1;b1++)
{
for(k1=0;k1<baris1;k1++)
{
printf(" %d",matrik1[k1][b1]);
}
printf("\n");
}

//transpose matrik 2
do
{
cout<<"jumlah baris : ";
cin>>baris2;
cout<<"jumlah kolom : ";
cin>>kolom2;
}
while ((baris2>10)||(kolom2>10));
cout<<"\nmatrix B"<<endl;
for(b2=0;b2<kolom2;b2++)
for(k2=0;k2<baris2;k2++)
{
cout<<"data [" <<b2<<","<<k2<<"]=";
cin>>matrik2[b2][k2];
}
for(b2=0;b2<kolom2;b2++)
{
cout<<'\n';
for(k2=0;k2<baris2;k2++)
cout<<setw(4)<<matrik1[b2][k2];
}

printf("\ntranspose matrik 2 : \n");
for(b2=0;b2<kolom2;b2++)
{
for(k2=0;k2<baris2;k2++)
{
printf(" %d",matrik2[k2][b2]);
}
printf("\n");
}

}getch();}

konversi Array 1 Dimensi menjadi 2 dimensi

#include <cstdlib>
#include <iostream>

using namespace std;

class convert{
friend istream& operator>>(istream&, convert&);
friend ostream& operator<<(ostream&, convert&);

public:
convert();
void pindah();

private:
int x[100],y[100][100];
int l,k,m,n;
};

convert::convert(){
cout<<"===============================\n"<<endl;
cout<<"Memindah Array 1 ke 2 Dimensi\n"<<endl;
cout<<"===============================\n"<<endl;
}

istream& operator>>(istream& in, convert& a){
cout<<"Masukkan Banyak Digit Array 1 Dimensi :";
in>>a.l;
for(int i=0; i<a.l; i++){
cout<<"Imput Data ke ["<<i+1<<"]:";
in>>a.x[i];
}

cout<<"\nMasukkan Baris Array 2 Dimensi :";
in>>a.n;
cout<<"\nMasukkan Kolom Array 2 Dimensi :";
in>>a.m;
return in;}

ostream& operator<<(ostream& out, convert& b){
out<<"Data Array 1 Dimensi :"<<endl;
for(int i=0; i<b.l; i++){
out<<b.x[i]<<" ";
}

out<<"\nData Array Setelah di Pindah :"<<endl;
for(int i=0; i<b.n; i++){
for(int j=0; j<b.m; j++){
out<<b.y[i][j]<<" ";
}
out<<endl;
}
return out;}

void convert::pindah(){
k=0;
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
y[i][j]=x[k];
k=k+1;
}
cout<<endl;
}
}

int main(int argc, char *argv[])
{
convert marty;
cin>>marty;
marty.pindah();
cout<<marty;

system("PAUSE");
return EXIT_SUCCESS;
}

Array 2 dimensi

#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{

int matrix[3][3];
int i,j;

for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
cout<<"Masukkan angka pada baris ke "<<i<<" kolom ke "<<j<<" : ";
cin>>matrix[i][j];
}
cout<<endl;
}
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
cout<<matrix[i][j]<<" ";
}
cout<<endl;
}

system("PAUSE");
return EXIT_SUCCESS;
}