This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Tampilkan postingan dengan label AL Posting. Tampilkan semua postingan
Tampilkan postingan dengan label AL Posting. Tampilkan semua postingan

Jumat, 04 Mei 2012

Pengertian Hardwere & Softwere

Pengertian Hardwere & Softwere

Pengertian Hardwere

Hardware adalah salah satu komponen dari sebuah komputer yang sifat alat nya bisa dilihat dan diraba secara langsung atau yang berbentuk nyata, yang berfungsi untuk mendukung proses komputerisasi. Contoh keyboard, mouse, printer, monitor, optical drive, dll.

Pengertian Softwere

Software adalah sekumpulan data elektronik yang disimpan dan diatur oleh komputer, data elektronik yang disimpan oleh komputer itu dapat berupa program atau instruksi yang akan menjalankan suatu perintah. Contoh Microsoft Office, Adobe Photoshop, CorelDRAW, dll.

Contoh Selection

Contoh Penggunaan Selection pada C++


#include<iostream.h>

int main(){

int a;
cout<<"masukkan bilangan bulat :";
cin>>a;
switch (a) {
case 1:
cout<<"angka 1"<<endl;
break;
case 2:
cout<<"angka 2"<<endl;
break;
case 3:
cout<<"angka 3"<<endl;
break;
default:
cout<<"selain 1,2,3"<<endl;
break;

 /*
if (a==0)
cout<<"nilai a adalah 0"<<endl;
   else if(a==1)
   cout<<"nilai a adalah 1"<<endl;
   else if(a==2)
   cout<<"nilai a adalah 3"<<endl;
   else if(a==3)
   cout<<"nilai a adalah 0,1,2, dan 3"<<endl;
   */
   }
return 0;
}

Program Menghitung Nilai

Program Untuk Menghitung Nilai 


#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
    int nilai;
    char huruf;
    
    cout<<"masukkan nilai : ";
    cin>>nilai;
    
    if((nilai>0) && (nilai<=20))
    huruf='E';
    else if((nilai>20) && (nilai<=40))
    huruf='D';
    else if((nilai>40) && (nilai<=60))
    huruf='C';
    else if((nilai>60) && (nilai<=80))
    huruf='B';
    else if((nilai>80) && (nilai<=100))
    huruf='A';
    else
    huruf='-';
    
    cout<<"nilai hurufnya adalah = "<<huruf<<endl;
    cout<<endl;
    
    system("PAUSE");
    return EXIT_SUCCESS;
}

Program Menghitung Jumlah Rata-rata

Program Menghitung Jumlah rata-rata 



#include <iostream.h>

int main()
{
int aray[100];
int n;
float rata,jumlah=0;
cout<<"masukkan data sebanyak = ";
cin>>n;

for(int i=0;i<n;i++){
cout<<"masukkan nilai["<<i+1<<"] : ";
cin>>aray[i];

}
cout<<endl;


for(int i=0;i<n;i++){
cout<<"nilai["<<i+1<<"] : ";
cout<<aray[i]<<endl;
jumlah +=aray[i];
}
cout<<endl;

rata=jumlah/n;
cout<<"jumlah data adalah = "<<jumlah<<endl;
cout<<"rata-ratanya adalah = "<<rata;




return 0;
}

Program C++ Untuk Menampilkan Hari

Program C++ Untuk menampilakan nama hari



#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
    int hari;
 
    cout<<"menentukan hari"<<endl;
    cout<<"1=senin  3=rabu  5=jum'at  7=minggu"<<endl;
    cout<<"2=selasa  4=kamis  6=sabtu"<<endl;
    cout<<endl;
    cout<<"masukkan kode hari (1-7) : ";
    cin>>hari;
 
    if(hari==1)
    cout<<"senin"<<endl;
    else if(hari==2)
    cout<<"selasa"<<endl;
    else if(hari==3)
    cout<<"rabu"<<endl;
    else if(hari==4)
    cout<<"kamis"<<endl;
    else if(hari==5)
    cout<<"jum'at"<<endl;
    else if(hari==6)
    cout<<"sabtu"<<endl;
    else if(hari==7)
    cout<<"minggu"<<endl;
    else
    cout<<"kode ini tidak di kenal"<<endl;
    cout<<endl;
 
    system("PAUSE");
    return EXIT_SUCCESS;
}

Program Akar Kuadrat C++

Program Untuk menghitung Akar Kuadrat menggunakan Dev C++ . Dibawah ini adalah program c++ untuk menghitung akar kuadrat dengan menggunakan program


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

using namespace std;

int main(int argc, char *argv[])
{
    int a,b,c;
    long disk;
    float x1,x2;
   
    cout<<"koefesien pankat 2 : ";cin>>a;
    cout<<"koefesien pankat 1 : ";cin>>b;
    cout<<"koefesien pankat 0 : ";cin>>c;
   
    if(a==0){
             cout<<"bukan persamaan kuadrat"<<endl;
             cout<<"harga akar = "<<-c/b;}
    else{
         disk=b*b-4*a*c;
         if (disk>0){
                     x1=-b+sqrt(disk)/(2*a);
                     x1=-b-sqrt(disk)/(2*a);
                     cout<<"diskriminan = "<<disk<<endl;
                     cout<<"x1 = "<<x1<<endl;
                     cout<<"x2 = "<<x2<<endl;}
         else if(disk==0){
              x1=-b/(2*a);
              x2=x1;
              cout<<"diskriminan = 0"<<endl;
              cout<<"x1 = "<<x1<<endl;
              cout<<"x2 = "<<x2<<endl;}
         else
         cout<<"Akar imajiner"<<endl;
         }
         cout<<endl;
       
    system("PAUSE");
    return EXIT_SUCCESS;
}