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
Posting Komentar