Jumat, 30 Maret 2012

Algoritma & Flowchart Menentukan Bilangan 100 habis dibagi 3 & 5

22.30

Indonesian version :
  • Flowchart :

  • Pendeskripsiannya :
  1. Terlebih dahulu mulai dari start.
  2. Kemudian kita berikan penguasaan dgn inputan penguasaan “i 0”.
  3. Kita masukan perulangannya (Looping).
  4. Setelah itu kita tentukan pengkondisian pertamanya : “i>100”.
  5. Setelah itu pengkondisian keduanya : “i%3=1 and i%5=1”.
  6. Jika pengkondisian bernilai “yes” maka akan di masuk di pemrosesan “i i+15” tetapi jika pengkondisian bernilai “no” maka output akan di cetak sbg “i” dan akan di masuk di pemrosesan “i i+15”.
  7. Proses tersebut akan terus dilakukan sampai nilai “i>100” trsbt terpenuhi.
  8. Selesai.

  • Syntax C++ :
#include <iostream>
#include <string>

using namespace std;
int main()
{
int i;

i =0;
while (!(i>100))
{
if (i % 3==1 && i % 5==1)
{
}
else
{
cout << i << endl; }
i =i+15;
}
system("PAUSE");
return 0;
}

  • Syntax C++ dengan structure Class :
#include <cstdlib>
#include <iostream>
using namespace std;
class bilangan{
friend ostream& operator<<(ostream&, bilangan&);
friend istream& operator>>(istream&, bilangan&);
public:
bilangan(){};
void proses(){
i =0;
while (!(i>100))
{ if (i % 3==1 && i % 5==1){
}
else
{
cout << i << endl; }
i =i+15;
}
}
private:
int i;
};
istream& operator>>(istream& in, bilangan& masukkan){
cout<<"Bilangan Yang Habis Dibagi 3 & 5 = "<<endl;
in >>masukkan.i;
return in;
}
ostream& operator<<(ostream& out, bilangan& keluaran){
cout<<"Bilangannya adalah "<<keluaran.i<<endl;
return out;
}
int main(int argc, char *argv[])
{
bilangan bil;
cin >> bil;
bil.proses();
cout<< bil;
cout<< endl;
system("PAUSE");
return 0;
}
English Version :

Ø  Flowchart:
 
Ø  Description of:
1.       Advance from the start.
2.        Then we give control of the control input with "i
3.       Our input recurrence (Looping).
4.       After that we specify the first conditioning: "i> 100".
5.       After the conditioning of both: "i% 3 = 1 and i% 5 = 1".
6.       If the conditioning value "yes" then it will be entered in the processing  i +15" but if the conditioning value "no" then the output willßof "i   i +15".be in print as "i" and will be entered in the processing of "i+15".
7.    The process will continue until the "i> 100" the met.
8.       Completed.

Ø  C + + syntax:
Ø  # Include <iostream>
# Include <string>

using namespace std;
int main ()
{
   int i;

   i = 0;
   while (! (i> 100))
   {
      if (i% 3 == 1 && i% 5 == 1)
      {
      }
      else
      {
         cout << i << endl;}
      i = i +15;
   }
   system ("PAUSE");
   return 0;
}


Ø  C + + syntax with Class structure:
# Include <cstdlib>
# Include <iostream>

using namespace std;

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

      public:
      number () {};

      void process () {
            i = 0;
            while (! (i> 100))
            {If (i% 3 == 1 && i% 5 == 1) {
      }
      else
      {
         cout << i << endl;}
      i = i +15;
      }
             }
          
      private:
              int i;
           
};

istream & operator >> (istream & in, & enter the numbers) {
    cout << "Numbers divisible by 3 & 5 =" << endl;
    in >> masukkan.i;

    return in;
}

ostream & operator << (ostream & out, numbers & output) {
    cout << "Bilangannya is" << keluaran.i << endl;

    return out;
}

int main (int argc, char * argv [])
{
    number bil;
    cin >> bil;
    bil.proses ();
    cout << bil;
    cout << endl;

    system ("PAUSE");
    return 0;
}


Written by

We are Creative Blogger Theme Wavers which provides user friendly, effective and easy to use themes. Each support has free and providing HD support screen casting.

0 komentar:

Posting Komentar

 

© 2013 Raizexe Blog. All rights resevered. Designed by Templateism

Back To Top