Selasa, 12 Maret 2013

DASAR JAVASECRIPT


<html>
<body>
<script type="text/javascript">
document.write("Web");
</script>
</body>
</html>

PERINTAH SELECT DI WEBSITE


<html>
<head>
<title>form</title>
</head>
<body>
<form>
Status:
<select name="status">
<option value="Menikah">Menikah
<option value="BelumMenikah">Belum Menikah
<option value="Janda">Janda
<option value="Duda">Duda
</select>
</form>
</body>
</html>

TEXTAREA WEBSITE


<html>
<head>
<title>form</title>
</head>
<body>
<form>
Komentar:
<textarea name="komentar" rows="6" cols="15">
</textarea>
</form>
</body>
</html>

CHECKBOXDI WEBSITE


<html>
<head>
<title>form</title>
</head>
<body>
<form>
Hobby: <br>
Olahraga<input type="checkbox" name="hobby" value="olahraga">
Musik<input type="checkbox" name="hobby" value="musik">
travelling<input type="checkbox" name="hobby" value="travelling">
</form>
</body>
</html>

FRAMESET DI WEBSITE


<html>
<head> <title> halaman </title>
</head>
<frameset>
<frame cols="65%,35%">
<frame src="span.html">
<frame src="ol.html">
</frameset>
<body>
</body>
</html>

MEMBUAT TABLE DI WEBSITE


<html>
<head>
<title>TABLE</title>
</head>
<body>
<table border="1">
<tr>
<td>satu</td>
<td>dua</td>
<td>tiga</td>
</tr>
<tr >
<td>satu</td>
<td>dua</td>
<td>tiga</td>
</tr>
</body>
</html>

WEBSITE FONT COLOR


<html>
<head>
<title>FONT COLOR</title>
</head>
<body>
<font color=“Blue”>Biru</font><br>
<font color=“Red”>Merah</font><br>
<font color=“#ff0000”> Merah Juga </font>
</body>
</html>

DASAR MEMBUAT WEBSITE


<html>
<head>
<title>JUDUL</title>
</head>
<body>
Ini Isinya
</body>
</html>

Rabu, 06 Maret 2013

ROGRAM IF


#include <iostream.h>
#include <conio.h>
#include <stdio.h>
main()
{
                char x;
                int IF,PILIHAN;
                clrscr();
                cout<<"MASUKKAN PILIHAN = ";cin>>PILIHAN;

                if (PILIHAN == 1)
                                {
                                int alas,tinggi,luas;

                                cout<<"\n\t\t\t PROGRAM IF LUAS SEGITIGA";
                                cout<<"\n\t\t\t\t *********\n";
                                cout<<"\t\n\t\n\t  masukkan alas=";cin>>alas;
                                cout<<"\t masukkan tinggi=";cin>>tinggi;
                                luas=alas*tinggi/2;
                                cout<<"luas segitiga="<<luas;
                                }
                else;
                {


                if  (PILIHAN  ==  2)
                {
                                int panjang,lebar,luas;

                                cout <<"\t\n\t\t PROGRAM IF LUAS PERSEGI PANJANG";
                                cout <<"\n\t\t\t**********\n";
                                cout <<"\t\n\t\n\t Masukkan Panjang=";cin>>panjang;
                                cout <<"\t Masukkan lebar=";cin>>lebar;
                                luas = panjang*lebar;
                                cout<<"Luas Persegi Panjang = "<<luas;
                                }
                else
                {

                if (PILIHAN==3)
                {
                                cout<<"\n\t EROR => MASUKKAN KARAKTER 1-2";
                }
                }
                }
                getch();
}

ROGRAM CASE


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


void main()
{
                char x;
                int alas,tinggi,luas,r;
                clrscr();
                cout<<"\t\t\t PROGRAM CASE\n";
                cout<<"\t\t\t BY SAGUH SETYAWAN\n";
                cout<<"\t\t\t *********\n";

                cout<<"\n Masukkan karakter: ";
                cin>>x;

                switch(x)
                {
                case '1':
                cout <<"PROGRAM CASE  SEGITIGA ::\n\n";
                cout <<"\t\t Nilai Alas =";cin>>alas;
                cout <<"\t\t Nilai Tinggi =";cin>>tinggi;
                luas = alas*tinggi/2;
                cout<<"\n\n LUAS SEGITIGA ="<<luas;
                break;

                case '2':
                int Panjang,Lebar,Luas;
                cout <<"\PROGRAM CASE PERSEGI PANJANG ::\n\n";
                cout <<"\t\t\t Masukkan Panjang = "; cin>>Panjang;
                cout <<"\t\t\t Masukkan Lebar = "; cin>>Lebar;
                Luas=Panjang*Lebar;
                cout<<"\n\n Luas Persegi Panjang = "<<Luas;
                break;

                case '3':
                default:
                printf  ("\n\t nilai yang anda masukkan salah,pilih karakter 1-2");
                }
                getch();
}

PROGRAM MENGHITUNG LUAS LINGKARAN


#include <iostream.h>
#include <conio.h>
#include <math.h>
main()
{

int JARIJARI,LUAS;

clrscr();
cout<<"Masukkan Jari-jarinya =";cin>>JARIJARI;
LUAS=2*3.14*JARIJARI*JARIJARI;
cout<<"Hasil Luas Lingikarang ="<<LUAS;
getch();
}

BENTUK HURUF SEGITIGA


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

class segitiga
{
                public :
                void rumus();
};

void main()
{
  segitiga x;
  x.rumus();
  getch();
}

void segitiga::rumus()
{
   for(int i=1; i<=5; i++)
   {
      for(int j=1; j<=i; j++)
      {
         if(j==1)
         {
            for(int k=i; k<=5; k++)
            {
               cout<<"  ";
            }
         }
         cout<<i<<"   ";
      }
      cout<<endl<<endl;
   }

}

PROGRAM WHILE-DO


#include  <iostream.h>
#include  <conio.h>
main  ()
{
                clrscr  ();
                 int  X = 5;
                 do
                                 {
                                                Int  Y = 5;
                                                 do
                                                 {
                                                                cout   <<Y<<"\t";
                                                                Y--;
                                                 }
                                                 while  ( Y >= X );
                                                 cout  <<"\n";
                                                 X--;
                                 }
                                 while  ( X >= 1 );
                                 getch  ();
}

PENGGURANGAN METRIK



#include <iostream.h>
#include <conio.h>
void main()
{
int matrix[20][30], matrix2[2][3],jumlah[2][3];
inth,k;
gotoxy(4,2);
cout<<"Pengurangan Matrix\n";
gotoxy(3,3);
cout<<"=+=+=+=+=+=+=+=+=+=+\n";
cout<<"matrix A :";
cout<<endl;
for (h=1;h<=2;h++)
    {
for(k=1;k<=3;k++)
       {
cout<<"masukkannilaibaris "<<h<<" kolom "<<k<<" : ";
cin>>matrix[h][k];
       }
    }
cout<<"\nMatrix B :\n";
for (h=1;h<=2;h++)
    {
for(k=1;k<=3;k++)
       {
cout<<"masukkannilaibaris "<<h<<" kolom "<<k<<" : ";
cin>>matrix2[h][k];
       }
    }
for (h=1;h<=2;h++)
    {
for(k=1;k<=3;k++)
       {
jumlah[h][k]=matrix[h][k] - matrix2[h][k];
       }
    }
cout<<endl;
gotoxy(1,20);
cout<<"\C = ";
for(h=1;h<=2;h++)
 {
for(k=1;k<=3;k++)
  {
gotoxy(3+4*k,17+2*h);
cout<<matrix[h][k];
  }
 }
gotoxy(17,20);
cout<<" - ";
for(h=1;h<=2;h++)
 {
for(k=1;k<=3;k++)
  {
gotoxy(18+4*k,17+2*h);
cout<<matrix2[h][k];
  }
 }
gotoxy(32,20);
cout<<" = ";
for(h=1;h<=2;h++)
 {
for(k=1;k<=3;k++)
  {
gotoxy(33+4*k,17+2*h);
cout<<jumlah[h][k];
  }
 }
getch();
}