Selasa, 27 Maret 2012

Refleksi Alpro pertemuan ke-5

ehemm ehemm.. asik asik..
minggu ke lima kali ini bener seru. tapi seperti biasa saiia datang tidak begitu terlambat.. ngepas lewat dikit.. :p

pertemuan kali ini membahas tentang "Function"... tapi refleksi kali ini berbeda dari sebelumnya. posting dengan bahasa inggris.. eah di coba,, minta bantuan mbah google iak.. translatein donk mbahh... XD


ok. from a description of the function ..
  • Basically the function returns a value
  • Function that does not return value is a procedure (which returned void)
  • Sometimes there is more than one parameter that changes its value in the function

of the explanation is given in some cases. but first, as always, we divided into groups. There are different this time. we are given a task to exchange the raptor had ever done before. of exchange of some of our group can complete the cases unresolved at the previous meeting. so it can post to the blog and for understanding the case.

so pretty this time of reflection. I think this meeting may help to clarify and better utilization of the use of raptors .. may be useful ..

and thank you so .. : p

Senin, 26 Maret 2012

CLASS ACTIVITY (Alpro-1)

Menulis algoritma sederhana untuk menarik sejumlah uang di ATM

Pengambilan Uang di ATM
>masuk ke dalam ruang mesin ATM
>ambil kartu ATM
>masukkan kartu ATM kedalam mesin ATM
>pilih bahasa yang akan digunakan Indonesia/ Inggris
>tulis nomor Pin (password)
>pilih transaksi yang ingin dilakukan
>pilih bagian “Penarikan Uang” yang ada pada layar
>pilih nominal uang yang akan diambil dan tekan OK/YES
>tunggu proses berlangsung
>uang akan Keluar dari mesin ATM dan Kartu ATM juga ikut keluar
>setelah kartu dan uang keluar maka akan keluar potongan kecil yang berisi rincian penarikan uang
>dan Anda dapat meninggalkan ATM tersebut.

Minggu, 25 Maret 2012

mencetak bilangan ganjil dari 0 sampai 10

Flowchart



















Programnya
#include <iostream>
#include <string>
using namespace std;
int main()
{
   int i;
   i =1;
   while
(!(i>10))
   {
      if (i % 2==0)
      {
      }
      else
      {
         cout << i << endl;      }
      i =i+1;
   }
   system("pause");
   return 0;
}

Menampilkan Rata-rata dari n bilangan bulat positif

Flowchart



programnya
#include <iostream>
#include <string>

using namespace std;
int main()
{
   string raptor_prompt_variable_zzyz;
   int n;
   int rata;
   int x;
   int i;
   int jumlah;

   raptor_prompt_variable_zzyz ="n =";
   cout << raptor_prompt_variable_zzyz << endl;
   cin >> n;
   jumlah =0;
   i =1;
   while (!(i>n))
   {
      raptor_prompt_variable_zzyz ="x =";
      cout << raptor_prompt_variable_zzyz << endl;
      cin >> x;
      jumlah =jumlah+x;
      i =i+1;
   }
   rata =jumlah/n;
   cout << jumlah << endl;   cout << rata << endl;
   system("pause");
   return 0;
}

menampilkan bilangan fibonacci (Loop)

Flowchart

Menghitunng perulangan rata-rata

Flowchart


















Programnya
#include <iostream>
#include <string>

using namespace std;
int main()
{
   string raptor_prompt_variable_zzyz;
   int n;
   int rata;
   int x;
   int i;
   float jumlah;

   raptor_prompt_variable_zzyz ="masukan n=";
   cout << raptor_prompt_variable_zzyz << endl;
   cin >> n;
   jumlah =0;
   i =1;
   while (!(i>n))
   {
      raptor_prompt_variable_zzyz =" masukan x=";
      cout << raptor_prompt_variable_zzyz << endl;
      cin >> x;
      jumlah =jumlah+x;
      i =i+1;
   }
   rata =jumlah;
   cout << rata << endl;
   system("pause");

   return 0;
}

mencetak angka 1 sampai 4

Flowchart


















Programnya
#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
cout<<"ini adalah program untuk menampilkan angka 1 sampai 4"<<endl;
for(int C=1;C<5;C++){
cout<<C<<endl;
}
system("PAUSE");
return EXIT_SUCCESS;
}

mencari akar persamaan kuadrat

Flowchart


Programnya
#include <iostream>
#include <string>

using namespace std;
int main()
{
   string raptor_prompt_variable_zzyz;
   float x2;
   float D;
   int b;
   int c;
   float x1;
   int a;

   raptor_prompt_variable_zzyz ="A = ";
   cout << raptor_prompt_variable_zzyz << endl;
   cin >> a;
   if (a!=0)
   {
      raptor_prompt_variable_zzyz ="B = ";
      cout << raptor_prompt_variable_zzyz << endl;
      cin >> b;
      raptor_prompt_variable_zzyz ="C = ";
      cout << raptor_prompt_variable_zzyz << endl;
      cin >> c;
      D =b^2-(4*a*c);
      if (D==0)
      {
         x1 =-b/2*a;
         x2 =x1;
         cout << "x1 = "<<x1<<" dan x2 = "<<x2 << endl;      }
      else
      {
         if (D>0)
         {
            x1 =(-b+sqrt(D))/2*a;
            x2 =(-b-sqrt(D))/2*a;
            cout << "x1 = "<<x1<<" dan x2 = "<<x2 << endl;         }
         else
         {
            cout << "akar imajiner" << endl;         }
      }
   }
   else
   {
      cout << "bukan persamaan kuadrat" << endl;   }
system("pause");
   return 0;
}

Algoritma konversi hari

Flowchart


Programnya
#include <iostream>
#include <string>

using namespace std;
int main()
{
   string raptor_prompt_variable_zzyz;
   int X;

   raptor_prompt_variable_zzyz ="masukkan hari ke-";
   cout << raptor_prompt_variable_zzyz << endl;
   cin >> X;
   if (X==1)
   {
      cout << "senin hari ke-" << X << endl;   }
   else
   {
      if (X==2)
      {
         cout << "selasa hari ke-" << X << endl;      }
      else
      {
         if (X==3)
         {
            cout << "rabu hari ke-" << X << endl;         }
         else
         {
            if (X==4)
            {
               cout << "kamis hari ke-" << X << endl;            }
            else
            {
               if (X==5)
               {
                  cout << "jumat hari ke-" << X << endl;               }
               else
               {
                  if (X==6)
                  {
                     cout << "sabtu hari ke-" << X << endl;                  }
                  else
                  {
                     if (X==7)
                     {
                        cout << "minggu hari ke-" << X << endl;                     }
                     else
                     {
                        cout << "BUKAN HARI" << endl;                     }
                  }
               }
            }
         }
      }
   }

   system ("PAUSE");
   return 0;
}