intelektual alternatives

algoritma pembagian harta waris (by varkhan, andy, musa, risna,haris,subandiyo ) with c-free

Posted on: 8 Juni 2011


#include
void suamitidakpunyaanak(){
int a,b,c,d,e,f,g,x,z,y;
float k,l,m,n,o,p;
printf(“\n”);
printf(“===================\n”);
printf(“Hitung Suami tidak punya anak\n”);
printf(“masukan jumlah warisan=”,’x’);scanf(“%i”,&x);
printf(“jumlah istri=”,’a’);scanf(“%i”,&a);
printf(“jumlah ibu=”,’e’);scanf(“%i”,&e);
printf(“jumlah bapak=”,’d’);scanf(“%i”,&d);
printf(“\n”);
printf(“bagian masing masing adalah:\n”);
printf(“===========================\n”);
k=(0.25*x);
l=(0.33*x);
m=x-(k+l);
printf(“warisan=%i\n”,x);
printf(“bagian istri=%f\n”,k);
printf(“bagian ibu=%f\n”,l);
printf(“bagian bapak=%f\n”,m);
}
void suamipunyaanak(){
int a,b,c,d,e,x;
float k,l,m,u,n,o,p,q,w,r,v,s,t;
printf(“\n”);
printf(“===================\n”);
printf(“Hitung Suami punya anak\n”);
printf(“===================\n”);
printf(“masukan jumlah warisan=”,’x’);scanf(“%i”,&x);
printf(“jumlah istri=”,’a’);scanf(“%i”,&a);
printf(“jumlah bapak=”,’b’);scanf(“%i”,&b);
printf(“jumlah ibu=”,’c’);scanf(“%i”,&c);
printf(“jumlah anak perempuan=”,’d’);scanf(“%i”,&d);
printf(“jumlah anak laki – laki=”,’e’);scanf(“%i”,&e);
printf(“\n”);
printf(“bagian masing masing adalah:\n”);
printf(“===========================\n”);
k=(0.125*x);
l=(0.16*x);
m=(k+l);
u=(x-m);
n=(d+e);
q=(e/n);
w=(q*u);
r=(0.5*w*d);
s=(w+r);
t=(u-s);
printf(“warisan=%i\n”,x);
printf(“bagian istri=%f\n”,k);
printf(“bagian ibu=%f\n”,l);
printf(“bagian anak laki laki=%f\n”,w);
printf(“bagian anak perempuan=%f\n”,r);
printf(“bagian bapak=%f\n”,t);
}
void suamiprtunggal (){
int a,b,c,d,e,f,g,x,z,y;
float k,l,m,n,o,p;
printf(“\n”);
printf(“===================\n”);
printf(“Hitung Suami punya anak perempuan tunggal\n”);
printf(“masukan jumlah warisan=”,’x’);scanf(“%i”,&x);
printf(“jumlah istri=”,’a’);scanf(“%i”,&a);
printf(“jumlah ibu=”,’b’);scanf(“%i”,&b);
printf(“jumlah bapak=”,’c’);scanf(“%i”,&c);
printf(“jumlah anak perempuan=”,’d’);scanf(“%i”,&d);
printf(“\n”);
printf(“bagian masing masing adalah:\n”);
printf(“===========================\n”);
k=(0.125*x);
l=(0.16*x);
m=(0.6*x);
n=(0.5*x);
o=x-(k+l+m);
p=x-(k+l+n);

if (d<=1){
printf(“warisan=%i\n”,x);
printf(“bagian istri=%f\n”,k);
printf(“bagian ibu=%f\n”,l);
printf(“bagian anak perempuan=%f\n”,n);
printf(“bagian bapak=%f\n”,p);
}else
{printf(“warisan=%i\n”,x);
printf(“bagian istri=%f\n”,k);
printf(“bagian ibu=%f\n”,l);
printf(“bagian anak perempuan=%f\n”,m);
printf(“bagian bapak=%f\n”,o);
}}
void suamilktunggal (){
int a,b,c,d,e,f,g,x,z,y;
float k,l,m,n,o,p;
printf(“\n”);
printf(“===================\n”);
printf(“Hitung Suami punya anak laki-laki tunggal\n”);
printf(“masukan jumlah warisan=”,’x’);scanf(“%i”,&x);
printf(“jumlah istri=”,’a’);scanf(“%i”,&a);
printf(“jumlah ibu=”,’b’);scanf(“%i”,&b);
printf(“jumlah bapak=”,’c’);scanf(“%i”,&c);
printf(“jumlah anak laki-laki=”,’d’,&d);
printf(“\n”);
printf(“bagian masing masing adalah:\n”);
printf(“===========================\n”);
k=(0.125*x);
l=(0.16*x);
m=(k+l);
n=(x-m);
o=(0.5*n);
printf(“warisan=%i\n”,x);
printf(“bagian istri=%f\n”,k);
printf(“bagian ibu=%f\n”,l);
printf(“bagian bapak=%f\n”,o);
printf(“bagian anak laki-laki=%f\n”,o);
}
void istritidakpunyaanak(){
int a,b,c,d,e,f,g,x,z,y;
float k,l,m,n,o,p;
printf(“\n”);
printf(“===================\n”);
printf(“Hitung istri tidak punya anak\n”);
printf(“masukan jumlah warisan=”,’x’);scanf(“%i”,&x);
printf(“jumlah suami=”,’a’);scanf(“%i”,&a);
printf(“jumlah ibu=”,’e’);scanf(“%i”,&e);
printf(“jumlah bapak=”,’d’);scanf(“%i”,&d);
printf(“\n”);
printf(“bagian masing masing adalah:\n”);
printf(“===========================\n”);
k=(0.5*x);
l=(0.33*x);
m=x-(k+l);
printf(“warisan=%i\n”,x);
printf(“bagian suami=%f\n”,k);
printf(“bagian ibu=%f\n”,l);
printf(“bagian bapak=%f\n”,m);
}
void istripunyaanak(){
int a,b,c,d,e,x;
float k,l,m,u,n,o,p,q,w,r,v,s,t;
printf(“\n”);
printf(“===================\n”);
printf(“Hitung istri punya anak\n”);
printf(“===================\n”);
printf(“masukan jumlah warisan=”,’x’);scanf(“%i”,&x);
printf(“jumlah suami=”,’a’);scanf(“%i”,&a);
printf(“jumlah bapak=”,’b’);scanf(“%i”,&b);
printf(“jumlah ibu=”,’c’);scanf(“%i”,&c);
printf(“jumlah anak perempuan=”,’d’);scanf(“%i”,&d);
printf(“jumlah anak laki – laki=”,’e’);scanf(“%i”,&e);
printf(“\n”);
printf(“bagian masing masing adalah:\n”);
printf(“===========================\n”);
k=(0.25*x);
l=(0.16*x);
m=(k+l);
u=(x-m);
n=(d+e);
q=(e/n);
w=(q*u);
r=(0.5*w*d);
s=(w+r);
t=(u-s);
printf(“warisan=%i\n”,x);
printf(“bagian suami=%f\n”,k);
printf(“bagian ibu=%f\n”,l);
printf(“bagian anak laki laki=%f\n”,w);
printf(“bagian anak perempuan=%f\n”,r);
printf(“bagian bapak=%f\n”,t);
}
void istriprtunggal(){
int a,b,c,d,e,f,g,x,z,y;
float k,l,m,n,o,p;
printf(“\n”);
printf(“===================\n”);
printf(“Hitung istri punya anak perempuan tunggal\n”);
printf(“masukan jumlah warisan=”,’x’);scanf(“%i”,&x);
printf(“jumlah suami=”,’a’);scanf(“%i”,&a);
printf(“jumlah ibu=”,’b’);scanf(“%i”,&b);
printf(“jumlah bapak=”,’c’);scanf(“%i”,&c);
printf(“jumlah anak perempuan=”,’d’);scanf(“%i”,&d);
printf(“\n”);
printf(“bagian masing masing adalah:\n”);
printf(“===========================\n”);
k=(0.25*x);
l=(0.16*x);
m=(0.6*x);
n=(0.5*x);
o=x-(k+l+m);
p=x-(k+l+n);

if (d<=1){
printf(“warisan=%i\n”,x);
printf(“bagian suami=%f\n”,k);
printf(“bagian ibu=%f\n”,l);
printf(“bagian anak perempuan=%f\n”,n);
printf(“bagian bapak=%f\n”,p);
}else
{printf(“warisan=%i\n”,x);
printf(“bagian suami=%f\n”,k);
printf(“bagian ibu=%f\n”,l);
printf(“bagian anak perempuan=%f\n”,m);
printf(“bagian bapak=%f\n”,o);
}}
void istrilktunggal(){
int a,b,c,d,e,f,g,x,z,y;
float k,l,m,n,o,p;
printf(“\n”);
printf(“===================\n”);
printf(“Hitung Suami punya anak laki-laki tunggal\n”);
printf(“masukan jumlah warisan=”,’x’);scanf(“%i”,&x);
printf(“jumlah suami=”,’a’);scanf(“%i”,&a);
printf(“jumlah ibu=”,’b’);scanf(“%i”,&b);
printf(“jumlah bapak=”,’c’);scanf(“%i”,&c);
printf(“jumlah anak laki-laki=”,’d’,&d);
printf(“\n”);
printf(“bagian masing masing adalah:\n”);
printf(“===========================\n”);
k=(0.125*x);
l=(0.16*x);
m=(k+l);
n=(x-m);
o=(0.5*n);
printf(“warisan=%i\n”,x);
printf(“bagian suami=%f\n”,k);
printf(“bagian ibu=%f\n”,l);
printf(“bagian bapak=%f\n”,o);
printf(“bagian anak laki-laki=%f\n”,o);
}
void menusuami(){
int pil; char ulang;
do{
printf(“\n”);
printf(“====================\n”);
printf(“Menu Suami\n”);
printf(“====================\n”);
printf(“1. hitung punya anak\n”);
printf(“2. hitung tidak punya anak\n”);
printf(“3. hitung anak perempuan tunggal\n”);
printf(“4. hitung anak laki laki tunggal\n”);
printf(“5. keluar\n”);
printf(“=================\n”);
printf(“pilihan anda : “);scanf(“%d”,&pil);
printf(“=================\n”);
switch(pil){
case 1: suamipunyaanak();
break;
case 2:suamitidakpunyaanak();
break;
case 3: suamiprtunggal();
break;
case 4: suamilktunggal();
break;
case 5: exit(0);
break;
default: printf(“pilihan Anda salah!\n”);
}
printf(“====================================\n”);
printf(“Kembali ke Menu Suami? (y/t) : “);scanf(“%c”,&ulang);scanf(“%c”,&ulang);
printf(“====================================\n”);
}while(ulang==’y’ || ulang==’Y’);
}

void menuistri(){
int pil; char ulang;
do{
printf(“\n”);
printf(“==================\n”);
printf(“Menu Istri\n”);
printf(“==================\n”);
printf(“1. hitung punya anak\n”);
printf(“2. hitung tidak punya anak\n”);
printf(“3. hitung anak perempuan tunggal\n”);
printf(“4. hitung anak laki laki tunggal\n”);
printf(“5. keluar\n”);
printf(“==================\n”);
printf(“pilihan anda : “);scanf(“%d”,&pil);
printf(“==================\n”);
switch(pil){
case 1: istripunyaanak();
break;
case 2:istritidakpunyaanak();
break;
case 3: istriprtunggal();
break;
case 4: istrilktunggal();
break;
case 5:exit(0);
break;
default:{ulang=’y’;
printf(“pilihan Anda salah!\n”);}
}
printf(“=========================================\n”);
printf(“Kembali ke Menu istri? (y/t) : “);scanf(“%c”,&ulang);scanf(“%c”,&ulang);
printf(“=========================================\n”);
}while (ulang==’y’ || ulang==’Y’);
}
//program utama
void main(){
int pilih;char ulang;
do{
printf(“\n”);
printf(“===============================\n”);
printf(“Menu Utama Program Warisan\n”);
printf(“Pilih yang meninggal\n”);
printf(“===============================\n”);
printf(“1. Suami\n”);
printf(“2. Istri\n”);
printf(“3. Keluar\n”);
printf(“================================\n”);
printf(“Pilihan Anda : “);scanf(“%d”,&pilih);
printf(“================================\n”);
switch(pilih){
case 1 : menusuami();
break;
case 2 : menuistri();
break;
case 3 : exit(0);
break;
default : printf(“Pilihan Anda Salah!\n”);
}
printf(“=================================\n”);
printf(“Kembali ke Menu Utama warisan? (y/t) : “);scanf(“%c”,&ulang);scanf(“%c”,&ulang);
printf(“=================================\n”);
}while(ulang==’y’ || ulang==’Y’);
}

1 Response to "algoritma pembagian harta waris (by varkhan, andy, musa, risna,haris,subandiyo ) with c-free"

terima kasih, buat referensi TA saya…

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: