Langsung ke konten utama

Pintar Bersama : Program C++


Source Code C++
#include <iostream>
using namespace std;

int main ()
{

A:
            int urut,pilih,A,B,C,D,E,F,G;
            char ulang, nama[30][10]={"Agung   ","Dimas    ","Abdul    ","Tiwi    ","Risky    ","Gita    ","Narti     ","Ari   ","Ridwan   ","Irgi    "};
            int tgl[10] = {2,16,7,4,9,20,8,12,6,3};
            int bln[10] = {2,9,7,10,4,2,8,3,11,5};
            int thn[10] = {1998,1997,1999,1996,1997,1995,1996,1998,1997,1999};
            cout<<"||========================================================||"<<endl;
            cout<<"||  Menampilkan Tanggal Lahir Berdasarkan Ganjil / Genap  ||"<<endl;
            cout<<"||========================================================||"<<endl;
            cout<<"|| Pilih Urutan :                                         ||"<<endl;
            cout<<"|| 1. Tanggal                                             ||"<<endl;
            cout<<"|| 2. Bulan                                               ||"<<endl;
            cout<<"|| 3. Tahun                                               ||"<<endl;
            cout<<"||========================================================||"<<endl;
            cout<<"|| Akan diurutkan Berdasarkan (1/2/3) ?? ";cin >>urut;

            switch (urut){
                        case 1:
                                    goto F;
B:
                                    switch (pilih){
                                                case 1:
                                                                                    for (int i=0;i<=9;i++){
                                                                                                if (tgl[i] % 2 == 1){
                                                                                                                        cout<<"|| Nama = "<<nama[i]<<" || Tanggal Lahir = "<<tgl[i]<<"-"<<bln[i]<<"-"<<thn[i]<<endl;
                                                                                                                        cout<<"||========================================================================||"<<endl;
                                                                                                            }
                                                                                    }goto E;
                                                break;
                                                case 2:
                                                            for (int i=0;i<=9;i++){
                                                                        if (tgl[i] % 2 == 0){
                                                                                    cout<<"|| Nama = "<<nama[i]<<" || Tanggal Lahir = "<<tgl[i]<<"-"<<bln[i]<<"-"<<thn[i]<<endl;
                                                                                    cout<<"||========================================================================||"<<endl;
                                                                        }
                                                            }goto E;
                                                break;
                                    }
                        break;
                        case 2:
                                    goto F;
C:
                                    switch (pilih){
                                                case 1:
                                                            for (int i=0;i<=9;i++){
                                                                        if (bln[i] % 2 == 1){
                                                                                    cout<<"|| Nama = "<<nama[i]<<" || Tanggal Lahir = "<<tgl[i]<<"-"<<bln[i]<<"-"<<thn[i]<<endl;
                                                                                    cout<<"||========================================================================||"<<endl;
                                                                        }
                                                            }goto E;
                                                break;
                                                case 2:
                                                            for (int i=0;i<=9;i++){
                                                                        if (bln[i] % 2 == 0){
                                                                                    cout<<"|| Nama = "<<nama[i]<<" || Tanggal Lahir = "<<tgl[i]<<"-"<<bln[i]<<"-"<<thn[i]<<endl;
                                                                                    cout<<"||========================================================================||"<<endl;
                                                                        }
                                                            }goto E;
                                                break;
                                    }
                        break;
                        case 3:
                                    goto F;
D:
                                    switch (pilih){
                                                case 1:
                                                            for (int i=0;i<=9;i++){
                                                                        if (thn[i] % 2 == 1){
                                                                                    cout<<"|| Nama = "<<nama[i]<<" || Tanggal Lahir = "<<tgl[i]<<"-"<<bln[i]<<"-"<<thn[i]<<endl;
                                                                                    cout<<"||========================================================================||"<<endl;
                                                                        }
                                                            }goto E;
                                                break;
                                                case 2:
                                                            for (int i=0;i<=9;i++){
                                                                        if (thn[i] % 2 == 0){
                                                                                    cout<<"|| Nama = "<<nama[i]<<" || Tanggal Lahir = "<<tgl[i]<<"-"<<bln[i]<<"-"<<thn[i]<<endl;
                                                                                    cout<<"||========================================================================||"<<endl;
                                                                        }
                                                            }goto E;
                                                break;
                                    }
                        break;
                        default:
                                    cout<<"|| Data Yang Anda Masukkan Salah!!!                                       ||"<<endl;
                                    cout<<"||========================================================================||"<<endl;
                                    goto G;
                        break;
            }
            cout<<"|| Data Yang Anda Masukkan Salah!!!                                       ||"<<endl;
            cout<<"||========================================================================||"<<endl;
E:
            cout<<"|| Apakah Ingin Memilih Ganjil/Genap Kembali(Y/T)?? ";cin >>ulang;
            cout<<"||========================================================================||"<<endl;
            if(ulang == 'y' || ulang == 'Y'){

                        goto F;
            } else {
                        goto G;
            }
F:

            cout<<"||========================================================================||"<<endl;
            cout<<"||        Menampilkan Tanggal Lahir Berdasarkan Ganjil / Genap            ||"<<endl;
            cout<<"||========================================================================||"<<endl;
            cout<<"|| 1.  Agung (2-2-1998) ||"<<endl;
            cout<<"|| 2.  Dimas (16-9-1997)||"<<endl;
            cout<<"|| 3.  Abdul (7-7-1999)||"<<endl;
            cout<<"|| 4.  Tiwi (4-10-1996)||"<<endl;
            cout<<"|| 5.  Risky (9-4-1997)||"<<endl;
            cout<<"|| 6.  Gita (20-2-1995) ||"<<endl;
            cout<<"|| 7.  Narti  (8-8-1996)||"<<endl;
            cout<<"|| 8.  Ari (12-3-1998) ||"<<endl;
            cout<<"|| 9.  Ridwan (6-11-1997)||"<<endl;
            cout<<"|| 10. Irgi (3-5-1999) ||"<<endl;
            cout<<"||========================================================================||"<<endl;
            cout<<"|| Pilih :                                                                ||"<<endl;
            cout<<"|| 1. Ganjil                                                              ||"<<endl;
            cout<<"|| 2. Genap                                                               ||"<<endl;
            cout<<"||========================================================================||"<<endl;
            cout<<"|| Masukkan Urutan Ganjil(1) atau Genap(2) = ";cin>>pilih;
            cout<<"||========================================================================||"<<endl;
            switch (urut){
                        case 1:
                                    goto B;
                                    break;
                        case 2:
                                    goto C;
                                    break;
                        case 3:
                                    goto D;
                                    break;
    }
G:
            cout <<"|| Apakah Ingin Mengulang Program Kembali(Y/T)?? ";cin >>ulang;
            if(ulang == 'y' || ulang == 'Y'){

                        goto A;
            } else {
                        cout<<"||========================================================================||"<<endl;
                        cout<<"|| Terima Kasih Telah Menggunakan Program ini!!"<<endl;
            }
            return 0;
}


















Komentar

Postingan populer dari blog ini

Pintar Bersama : MAKALAH DALIL RANTAI ATAU ATURAN RANTAI DALAM TURUNAN

MAKALAH DALIL RANTAI ATAU ATURAN RANTAI DALAM TURUNAN Disusun oleh: Dewi Martiwi Radiyanti (1522390141) Dosen Pembimbing: Ruruh Wuryani, S.Si, MM STMIK RAHARJA KOTA TANGERANG Jl. Jendral Sudirman No. 40 Modern-Tangerang, Banten 15117 Telepon : 021-552-9692, 021-552-9586 KATA PENGANTAR Puji syukur saya panjatkan kehadirat Tuhan Yang Maha Esa karena dengan rahmat, karunia, serta taufik dan hidayah-Nya kami dapat menyelesaikan makalah tentang   Dalil Rantai atau Aturan Rantai dalam Turunan ini dengan baik meskipun banyak kekurangan didalamnya. Dan juga kami berterima kasih pada Ibu Ruruh Wuryani S.Si MM, selaku Dosen mata kuliah Kalkulus yang telah memberikan tugas ini kepada saya.        Saya sangat berharap makalah ini dapat berguna dalam rangka menambah wawasan serta pengetahuan tentang Dalil Rantai dalam Turunan. Saya juga menyadari sepenuhnya bahwa di dalam makalah ini terdapat kekurangan dan jauh dari kata sempurna. Oleh ...

Terlambat Satu Hari

Sebentar, saya bingung mulai darimana.  Sebentar, saya coba ingat-ingat dahulu.  Otak memang gudang segala memori, saya coba pilah sebentar.  Tentangmu yang tak pernah berbicara banyak.  Tentangmu dengan segala ambisi dan mimpi-mimpi besar. Tentangmu dan harum boneka cokelat.  Kemarin kawan saya tak sengaja menyinggung kamu dipercakapan kami, "ya gitu, kemarin ga jadi main. ga ada kabar" ucap kawan saya.  "trus ga jadi nonton?" saya membalas.  "aku sih engga, tapi dia mah sendiri juga jadi" "hahaha, tetep ya ga berubah" Ha ha ha, ga berubah?  Seperti saya mengenal kamu, nyatanya tidak. Saya sudah tidak tau kebiasaanmu lagi, kabarmu, kegiatanmu di kampus, kawanmu disana, atau kepulanganmu tiap libur semester. Saya tetap tidak berani bertanya atau sekedar berkirim salam lewat temanmu.  Saya cuma berani mendoakan, jauh dari tempat kamu saat ini.  Saya sudah kehabisan kata, pun tidak berhak tentang ap...

A letter for... A

I dont care where he is, who he is dating with, drinking with, holding hands with, hugging with, i couldnt care less who he is into, I feel jealous a lot, but more to like why i cant be near him to just see him, I care about how he is. Just how he is. How he feels, how his day goes by, how is his dream catching progressed, is he healthy, mentally safe and warm. I am fine.