rumus takdil dalam falaq

Topik sebelumnya Topik selanjutnya Go down

rumus takdil dalam falaq

Post  zz on Mon Feb 16, 2009 4:10 am

#include <iostream>
using namespace std;
class takdil
{
int a,b,c;//awal dari segalanya
int saw1,daq1,dar1,SAW1,DAQ1,DAR1;//satrul awwal dan tsani
int KAS,KAS1;//sawani kasr,daqiqoh fadl
int fadl,fadl1,fadl2;//sawani fadl,daqiqoh fadl,darajah fadl
int e,e1,e2;//sisa pembagian bila lebiih dari 60
int h,h1,h2;//hasil pembagian bila lebih dari 60
int s,s1,s2,s3;//simpan 1 bila kurang dari 60 tapi lebih dari 30
int z,z1,z2;//ini jumlah rowabik,sawalis,sawani setelah ditambahkan
int sisa,sisa1,sisa2;
int takdil_saw,takdil_daq,takdil_dar;
int f_saw,f_daq,f_dar;
public:
int setvalue(int saw,int daq, int dar,int SAW,int DAQ,int DAR){saw1=saw,daq1=daq,dar1=dar, SAW1=SAW,DAQ1=DAQ,DAR1=DAR;}//memasukkan satrul, saw=awwal,SAW=tsani
int setvalue1(int kas,int kas1){KAS=kas,KAS1=kas1;}//memasukkan kasrul
void pros1();//ini untuk mencari fadl bainahuma
void pros2();//ini untuk mencari rowabik,sawalis,sawani
void pros3();//ini untuk mencari takdil
void final();//mencari takdil
int oke_saw(){return f_saw;}
int oke_daq(){return f_daq;}
int oke_dar(){return f_dar;}
void tak_s();
};
//...........................................................segala proses takdil................................................
//...........................................................mencari fadl bainahuma..............................................
//...........................................................mencari fadl bainahuma..............................................
void takdil::pros1(){
int sr,sr1;
if (((saw1)+(daq1*60)+(dar1*7200))<((SAW1)+(DAQ1*60)+(DAR1*7200)))//satrul sani dikurangi satrul awwal
{//fadl=SAW1-saw1;
if (SAW1-saw1<0)
{fadl=SAW1-saw1+60;sr=-1;}
else {fadl=SAW1-saw1;sr=0;}
//..............................................................................................................
//fadl1=DAQ1-daq1+sr;
if (DAQ1-daq1+sr<0)
{fadl1=DAQ1-daq1+sr+60;sr1=-1;}
else {fadl1=DAQ1-daq1+sr;sr1=0;}
//................................................................................................................
//fadl2=DAR1-dar1+sr1;
if (DAR1-dar1+sr1<0)
{fadl2=DAR1-dar1+sr1+30;sr1=-1;}
else {fadl2=DAR1-dar1+sr1;sr1=0;}

cout<<fadl<<","<<fadl1<<","<<fadl2<<"lebih kecil"<<endl;//bila ini dibunuh maka hasil fungsi tidak otomatis muncul dilayar
;}
else if (((saw1)+(daq1*60)+(dar1*7200))>((SAW1)+(DAQ1*60)+(DAR1*7200)))//satrus awal dikurangi satrus sani
{//fadl=saw1-SAW1;
if (saw1-SAW1<0)
{fadl=saw1-SAW1+60;sr=-1;}
else {fadl=saw1-SAW1;sr=0;}
//..............................................................................................................
//fadl1=daq1-DAQ1+sr;
if (daq1-DAQ1+sr<0)
{fadl1=daq1-DAQ1+sr+60;sr1=-1;}
else {fadl1=daq1-DAQ1+sr;sr1=0;}
//................................................................................................................
//fadl2=dar1-DAR1+sr1;
if (dar1-DAR1+sr1<0)
{fadl2=dar1-DAR1+sr1+30;sr1=-1;}
else {fadl2=dar1-DAR1+sr1;sr1=0;}

cout<<fadl<<","<<fadl1<<","<<fadl2<<"lebih besar"<<endl;
}
else {fadl=0;fadl1=0;fadl2=0;}
//{cout<<"erreo"<<endl;}
}
//.............................................mencari rowabik, sawalis dan sawani...........................
//...........................................................................................................
//...........................................................................................................
void takdil::pros2(){
a=fadl*KAS;b=(fadl1*KAS)+(fadl*KAS1);c=fadl1*KAS1;//sawani fadl,
}
//...........................................................................................................
//............................................prosess pembagian...............................................................
//...........................................................................................................
void takdil::pros3(){
//int h,h1,h2,h3;
if ((a%60>30)&&(a>60))
{e=1;sisa=a%60;}
else {e=0;sisa=0;}
if (a>30)//.............rowabik..............................................................................
{
if (a>60)
{ h=(a/60)+e;s=0;}
else
{h=0;s=1;}
}
else
{h=0;s=0;}
//h1=e+h+b;
//................sawalis............................................................................
if (((e+h+b+s)%60>30)&&((e+h+b+s)>60))
{e1=1;sisa1=(e+h+b+s)%60;}
else {e1=0;sisa1=0;}
if (e+h+b+s>30)
{
if (e+h+b+s>60)
{h1=(e+h+b+s)/60+(e1);s1=0;}
else
{h1=0;s1=1;}
}
else
{h1=0;s1=0;}
//.......................sawani....bila tidak sampai 60 maka langsung menjadi angka takdil..............
if (((h1+s1+c)%60>30)&&((h1+c+s1)>60))
{e2=1;sisa2=(h1+s1+c)%60;cout<<"hello"<<endl;}
else{e2=0;sisa2=(h1+s1+c)%60;}
if (e1+h1+s1+c>30) {
if (e1+h1+s1+c>60)
{h2=(h1+s1+c)/60;s2=0;}
else
{h2=0;s2=1;cout<<"hel"<<endl;}
}
else
{h2=0;s2=0;}
z=a;z1=b+s+h;z2=c+s1+h1;
cout<<"awal pra tambah : "<<a<<","<<b<<","<<c<<endl;
cout<<"jumlah total : "<<z<<","<<z1<<","<<z2<<endl;
cout<<"hasil pembagian bila x>60 : "<<h<<","<<h1<<","<<h2<<endl;
cout<<"simpan bila 30<x<60 : "<<s<<","<<s1<<","<<s2<<endl;
cout<<"sisa pembagian bila x>60 : "<<e<<","<<e1<<","<<e2<<endl;
cout<<"sisa pembagian bila x>60 : "<<sisa<<","<<sisa1<<","<<sisa2<<endl;

//return 0;
}
//...................................................Mencari takdil.............................................................
//...................................................Mencari takdil.............................................................
//...................................................Mencari takdil.............................................................
void takdil::final(){
if (z2>60)
{takdil_saw=sisa2;takdil_daq=h2;takdil_dar=0;cout<<"5"<<endl;}
else if ((z2<60)&&(z2>0))//memasukkan apa saja bila di sawani masih ada angka
{takdil_saw=z2;takdil_daq=0;takdil_dar=0;cout<<"vvvvvvvvv"<<endl;}
else if((z1<=30)&&(z2=0))// ini kemungkinan terakhir
{takdil_saw=saw1;takdil_daq=daq1;takdil_dar=dar1;cout<<"3"<<endl;}
else if(z1<=30)
{takdil_saw=saw1;takdil_daq=daq1;takdil_dar=dar1;cout<<"4"<<endl;}
else
{cout<<"error, laporkan ini pada kami, fatihul-ulum manggisan";}
}
//...................................................mencari takdil_samsi..........................................................
//...................................................mencari takdil_samsi..........................................................
//...................................................mencari takdil_samsi..........................................................
void takdil::tak_s(){
pros1 ();
pros2 ();
pros3 ();
final ();
int s,s1,s2;
if(z2>60)
{if (((saw1)+(daq1*60)+(dar1*7200))<((SAW1)+(DAQ1*60)+(DAR1*7200)))
{if (saw1+takdil_saw>=60)
{f_saw=saw1+takdil_saw-60;s=1;}
else {f_saw=saw1+takdil_saw;s=0;}
if (daq1+takdil_daq+s>=60)
{f_daq=daq1+takdil_daq+s-60;s1=1;}
else {f_daq=daq1+takdil_daq+s;s1=0;}
if (dar1+takdil_dar+s1>=30)
{f_dar=dar1+takdil_dar+s1+30;s2=1;}
else {f_dar=dar1+takdil_dar+s1;s2=0;}
cout<<"hello"<<endl;}
//kemungkinan kedua
else if (((saw1)+(daq1*60)+(dar1*7200))>((SAW1)+(DAQ1*60)+(DAR1*7200)))
{ if (saw1-takdil_saw<0)
{f_saw=saw1-takdil_saw+60;s=-1;}
else {f_saw=saw1-takdil_saw;s=0;}
if (daq1-takdil_daq+s<0)
{f_daq=daq1-takdil_daq+s+60;s1=-1;}
else {f_daq=daq1-takdil_daq+s;s1=0;}
if (dar1-takdil_dar+s1<0)
{f_dar=dar1-takdil_dar+s1+30;s2=-1;}
else {f_dar=dar1-takdil_dar+s1;s2=0;}
cout<<"dikurangi"<<endl;}
else {f_saw=takdil_saw;f_daq=takdil_daq;f_dar=takdil_dar;}
}
//..............................pusing..................................................................
else if ((z2<60)&&(z2>0))
{if (((saw1)+(daq1*60)+(dar1*7200))<((SAW1)+(DAQ1*60)+(DAR1*7200)))
{if (saw1+takdil_saw>=60)
{f_saw=saw1+takdil_saw-60;s=1;}
else {f_saw=saw1+takdil_saw;s=0;}
if (daq1+takdil_daq+s>=60)
{f_daq=daq1+takdil_daq+s-60;s1=1;}
else {f_daq=daq1+takdil_daq+s;s1=0;}
if (dar1+takdil_dar+s1>=30)
{f_dar=dar1+takdil_dar+s1+30;s2=1;}
else {f_dar=dar1+takdil_dar+s1;s2=0;}
cout<<"hello"<<endl;}
//kemungkinan kedua
else if (((saw1)+(daq1*60)+(dar1*7200))>((SAW1)+(DAQ1*60)+(DAR1*7200)))
{ if (saw1-takdil_saw<0)
{f_saw=saw1-takdil_saw+60;s=-1;}
else {f_saw=saw1-takdil_saw;s=0;}
if (daq1-takdil_daq+s<0)
{f_daq=daq1-takdil_daq+s+60;s1=-1;}
else {f_daq=daq1-takdil_daq+s;s1=0;}
if (dar1-takdil_dar+s1<0)
{f_dar=dar1-takdil_dar+s1+30;s2=-1;}
else {f_dar=dar1-takdil_dar+s1;s2=0;}
cout<<"hei"<<endl;}
else {f_saw=takdil_saw;f_daq=takdil_daq;f_dar=takdil_dar;}
}
else {f_saw=takdil_saw;f_daq=takdil_daq;f_dar=takdil_dar;cout<<endl;}
}

int main ()
{
takdil tak;
tak.setvalue ( 2,3,5,1,3,4 );
/*angka diatas boleh diganti, tiga angka pertama untuk satrul awal an selanjutnya satrul sani*/
tak.setvalue1 (2,3);
/*angka ini untu kasrul mahfud, bagi mereka yang malas takdil, mungkin ini solusinya*/
tak.tak_s();
}
/*yang ada disini bila langsung dikompile, insya allah bila ada kesalahan atau apapun menyangkut error bisa langsung di posting, */

zz
Panglima
Panglima

Jumlah posting : 121
Age : 71
Lokasi : france
Registration date : 13.02.09

Lihat profil user

Kembali Ke Atas Go down

Topik sebelumnya Topik selanjutnya Kembali Ke Atas


 
Permissions in this forum:
Anda tidak dapat menjawab topik