Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* TUGAS LOGIKA MATEMATIKA
- * PROGRAM LOGIKA 4 PROPOSISI (P, Q, R, S)
- *
- * FAHRU ROJI (065111006)
- * FATHURRACHMAN (065111007)
- * ANGGA SAPUTRA (065111009)
- * MUHAMAD BANYU MUBAROK (065111028)
- *
- */
- #include <iostream.h>
- #include <conio.h>
- konjungsi()
- {
- {
- clrscr();
- int p[16], q[16], r[16], s[16];
- int o, x;
- cout<<"========================================"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI KONJUNGSI ( ^ )"<<endl;
- cout<<"========================================"<<endl;
- cout<<"1. P dan Q"<<endl;
- cout<<"2. P dan R"<<endl;
- cout<<"3. P dan S"<<endl;
- cout<<"4. Q dan R"<<endl;
- cout<<"5. Q dan S"<<endl;
- cout<<"6. R dan S"<<endl<<endl;
- cout<<"PILIH PROPOSISI: "; cin>>o;
- clrscr();
- switch(o)
- {
- case 1:
- {
- cout<<"------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA KONJUNGSI ( ^ ) P dan Q"<<endl;
- cout<<"------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi P: "; cin>>p[x];
- }
- clrscr();
- cout<<"------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA KONJUNGSI ( ^ ) P dan Q"<<endl;
- cout<<"------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi Q: "; cin>>q[x];
- }
- clrscr();
- cout<<"------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA KONJUNGSI ( ^ ) P dan Q"<<endl;
- cout<<"------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(p[x] == 1 && q[x] == 1)
- {cout<<"P dan Q = "<<p[x]<<endl;}
- else if(p[x] == 1 && q[x] == 0)
- {cout<<"P dan Q = "<<q[x]<<endl;}
- else if(p[x] == 0 && q[x] == 1)
- {cout<<"P dan Q = "<<p[x]<<endl;}
- else if(p[x] == 0 && q[x] == 0)
- {cout<<"P dan Q = "<<q[x]<<endl;}
- }
- ;break;
- }
- case 2:
- {
- cout<<"------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA KONJUNGSI ( ^ ) P dan R"<<endl;
- cout<<"------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi P: "; cin>>p[x];
- }
- clrscr();
- cout<<"------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA KONJUNGSI ( ^ ) P dan Q"<<endl;
- cout<<"------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi R: "; cin>>r[x];
- }
- clrscr();
- cout<<"------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA KONJUNGSI ( ^ ) P dan Q"<<endl;
- cout<<"------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(p[x] == 1 && r[x] == 1)
- {cout<<"P dan R = "<<p[x]<<endl;}
- else if(p[x] == 1 && r[x] == 0)
- {cout<<"P dan R = "<<r[x]<<endl;}
- else if(p[x] == 0 && r[x] == 1)
- {cout<<"P dan R = "<<p[x]<<endl;}
- else if(p[x] == 0 && r[x] == 0)
- {cout<<"P dan R = "<<r[x]<<endl;}
- };break;
- }
- case 3:
- {
- cout<<"------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA KONJUNGSI ( ^ ) P dan S"<<endl;
- cout<<"------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi P: "; cin>>p[x];
- }
- clrscr();
- cout<<"------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA KONJUNGSI ( ^ ) P dan Q"<<endl;
- cout<<"------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi S: "; cin>>s[x];
- }
- clrscr();
- cout<<"------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA KONJUNGSI ( ^ ) P dan Q"<<endl;
- cout<<"------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(p[x] == 1 && q[x] == 1)
- {cout<<"P dan Q = "<<p[x]<<endl;}
- else if(p[x] == 1 && s[x] == 0)
- {cout<<"P dan Q = "<<s[x]<<endl;}
- else if(p[x] == 0 && s[x] == 1)
- {cout<<"P dan Q = "<<p[x]<<endl;}
- else if(p[x] == 0 && s[x] == 0)
- {cout<<"P dan Q = "<<s[x]<<endl;}
- };break;
- }
- case 4:
- {
- cout<<"------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA KONJUNGSI ( ^ ) Q dan R"<<endl;
- cout<<"------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi Q: "; cin>>q[x];
- }
- clrscr();
- cout<<"------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA KONJUNGSI ( ^ ) P dan Q"<<endl;
- cout<<"------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi R: "; cin>>r[x];
- }
- clrscr();
- cout<<"------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA KONJUNGSI ( ^ ) P dan Q"<<endl;
- cout<<"------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(q[x] == 1 && r[x] == 1)
- {cout<<"Q dan R = "<<q[x]<<endl;}
- else if(q[x] == 1 && r[x] == 0)
- {cout<<"Q dan R = "<<r[x]<<endl;}
- else if(q[x] == 0 && r[x] == 1)
- {cout<<"Q dan R = "<<q[x]<<endl;}
- else if(q[x] == 0 && r[x] == 0)
- {cout<<"Q dan R = "<<r[x]<<endl;}
- };break;
- }
- case 5:
- {
- cout<<"------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA KONJUNGSI ( ^ ) Q dan S"<<endl;
- cout<<"------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi Q: "; cin>>q[x];
- }
- clrscr();
- cout<<"------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA KONJUNGSI ( ^ ) P dan Q"<<endl;
- cout<<"------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi S: "; cin>>s[x];
- }
- clrscr();
- cout<<"------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA KONJUNGSI ( ^ ) P dan Q"<<endl;
- cout<<"------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(q[x] == 1 && s[x] == 1)
- {cout<<"Q dan S = "<<q[x]<<endl;}
- else if(q[x] == 1 && s[x] == 0)
- {cout<<"Q dan S = "<<s[x]<<endl;}
- else if(q[x] == 0 && s[x] == 1)
- {cout<<"Q dan S = "<<q[x]<<endl;}
- else if(q[x] == 0 && s[x] == 0)
- {cout<<"Q dan S = "<<s[x]<<endl;}
- };break;
- }
- case 6:
- {
- cout<<"------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA KONJUNGSI ( ^ ) R dan S"<<endl;
- cout<<"------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi R: "; cin>>r[x];
- }
- clrscr();
- cout<<"------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA KONJUNGSI ( ^ ) R dan S"<<endl;
- cout<<"------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi S: "; cin>>s[x];
- }
- clrscr();
- cout<<"------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA KONJUNGSI ( ^ ) P dan Q"<<endl;
- cout<<"------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(r[x] == 1 && s[x] == 1)
- {cout<<"R dan S = "<<r[x]<<endl;}
- else if(r[x] == 1 && s[x] == 0)
- {cout<<"R dan S = "<<s[x]<<endl;}
- else if(r[x] == 0 && s[x] == 1)
- {cout<<"R dan S = "<<r[x]<<endl;}
- else if(r[x] == 0 && s[x] == 0)
- {cout<<"R dan S = "<<s[x]<<endl;}
- };break;
- }
- default:
- {
- cout<<"Maaf Entri Salah"<<endl;
- }
- }
- cout<<"\nKetik enter untuk melanjutkan !! "<<endl;
- }
- return 0;
- }
- disjungsi()
- {
- {
- clrscr();
- int p[16], q[16], r[16], s[16];
- int o, x;
- cout<<"----------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI DISJUNGSI ( v )"<<endl;
- cout<<"----------------------------------------"<<endl<<endl;
- cout<<"1. P atau Q"<<endl;
- cout<<"2. P atau R"<<endl;
- cout<<"3. P atau S"<<endl;
- cout<<"1. Q atau R"<<endl;
- cout<<"2. Q atau S"<<endl;
- cout<<"3. R atau S"<<endl<<endl;
- cout<<"PILIH PROPOSISI: "; cin>>o;
- clrscr();
- switch(o)
- {
- case 1:
- {
- cout<<"-------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA DISJUNGSI ( v ) P atau Q"<<endl;
- cout<<"-------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi P: "; cin>>p[x];
- }
- clrscr();
- cout<<"----------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI DISJUNGSI ( v )"<<endl;
- cout<<"----------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi Q: "; cin>>q[x];
- }
- clrscr();
- cout<<"----------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI DISJUNGSI ( v )"<<endl;
- cout<<"----------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(p[x] == 1 && q[x] == 1)
- {cout<<"P atau Q = "<<p[x]<<endl;}
- else if(p[x] == 1 && p[x] == 0)
- {cout<<"P atau Q = "<<q[x]<<endl;}
- else if(p[x] == 0 && q[x] == 1)
- {cout<<"P atau Q = "<<q[x]<<endl;}
- else if(p[x] == 0 && q[x] == 0)
- {cout<<"P atau Q = "<<q[x]<<endl;}
- }
- ;break;
- }
- case 2:
- {
- cout<<"-------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA DISJUNGSI ( v ) P atau R"<<endl;
- cout<<"-------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi P: "; cin>>p[x];
- }
- clrscr();
- cout<<"----------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI DISJUNGSI ( v )"<<endl;
- cout<<"----------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi R: "; cin>>r[x];
- }
- clrscr();
- cout<<"----------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI DISJUNGSI ( v )"<<endl;
- cout<<"----------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(p[x] == 1 && r[x] == 1)
- {cout<<"P atau R = "<<p[x]<<endl;}
- else if(p[x] == 1 && r[x] == 0)
- {cout<<"P atau R = "<<p[x]<<endl;}
- else if(p[x] == 0 && r[x] == 1)
- {cout<<"P atau R = "<<r[x]<<endl;}
- else if(p[x] == 0 && r[x] == 0)
- {cout<<"P atau R = "<<r[x]<<endl;}
- };break;
- }
- case 3:
- {
- cout<<"-------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA DISJUNGSI ( v ) P atau S"<<endl;
- cout<<"-------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi P: "; cin>>p[x];
- }
- clrscr();
- cout<<"----------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI DISJUNGSI ( v )"<<endl;
- cout<<"----------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi S: "; cin>>s[x];
- }
- clrscr();
- cout<<"----------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI DISJUNGSI ( v )"<<endl;
- cout<<"----------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(p[x] == 1 && s[x] == 1)
- {cout<<"P atau Q = "<<p[x]<<endl;}
- else if(p[x] == 1 && s[x] == 0)
- {cout<<"P atau Q = "<<p[x]<<endl;}
- else if(p[x] == 0 && s[x] == 1)
- {cout<<"P atau Q = "<<s[x]<<endl;}
- else if(p[x] == 0 && s[x] == 0)
- {cout<<"P atau Q = "<<s[x]<<endl;}
- };break;
- }
- case 4:
- {
- cout<<"-------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA DISJUNGSI ( v ) Q atau R"<<endl;
- cout<<"-------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi Q: "; cin>>q[x];
- }
- clrscr();
- cout<<"----------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI DISJUNGSI ( v )"<<endl;
- cout<<"----------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi R: "; cin>>r[x];
- }
- clrscr();
- cout<<"----------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI DISJUNGSI ( v )"<<endl;
- cout<<"----------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(q[x] == 1 && r[x] == 1)
- {cout<<"Q atau R = "<<q[x]<<endl;}
- else if(q[x] == 1 && r[x] == 0)
- {cout<<"Q atau R = "<<q[x]<<endl;}
- else if(q[x] == 0 && r[x] == 1)
- {cout<<"Q atau R = "<<r[x]<<endl;}
- else if(q[x] == 0 && r[x] == 0)
- {cout<<"Q atau R = "<<r[x]<<endl;}
- };break;
- }
- case 5:
- {
- cout<<"-------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA DISJUNGSI ( v ) Q atau S"<<endl;
- cout<<"-------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi Q: "; cin>>q[x];
- }
- clrscr();
- cout<<"----------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI DISJUNGSI ( v )"<<endl;
- cout<<"----------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi S: "; cin>>s[x];
- }
- clrscr();
- cout<<"----------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI DISJUNGSI ( v )"<<endl;
- cout<<"----------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(q[x] == 1 && s[x] == 1)
- {cout<<"Q atau S = "<<q[x]<<endl;}
- else if(q[x] == 1 && s[x] == 0)
- {cout<<"Q atau S = "<<q[x]<<endl;}
- else if(q[x] == 0 && s[x] == 1)
- {cout<<"Q atau S = "<<s[x]<<endl;}
- else if(q[x] == 0 && s[x] == 0)
- {cout<<"Q atau S = "<<s[x]<<endl;}
- };break;
- }
- case 6:
- {
- cout<<"-------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA DISJUNGSI ( v ) R atau S"<<endl;
- cout<<"-------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi R: "; cin>>s[x];
- }
- clrscr();
- cout<<"----------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI DISJUNGSI ( v )"<<endl;
- cout<<"----------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi S: "; cin>>s[x];
- }
- clrscr();
- cout<<"----------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI DISJUNGSI ( v )"<<endl;
- cout<<"----------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(r[x] == 1 && s[x] == 1)
- {cout<<"R atau S = "<<r[x]<<endl;}
- else if(r[x] == 1 && s[x] == 0)
- {cout<<"R atau S = "<<r[x]<<endl;}
- else if(r[x] == 0 && s[x] == 1)
- {cout<<"R atau S = "<<s[x]<<endl;}
- else if(r[x] == 0 && s[x] == 0)
- {cout<<"R atau S = "<<s[x]<<endl;}
- };break;
- }
- default:
- {
- cout<<"Maaf Entri Salah"<<endl;
- }
- }
- cout<<"\nKetik enter untuk melanjutkan !! "<<endl;
- }
- return 0;
- }
- implikasi()
- {
- {
- clrscr();
- int p[16], q[16], r[16], s[16];
- int o, x;
- cout<<"-------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI IMPLIKASI ( ---> )"<<endl;
- cout<<"-------------------------------------------"<<endl<<endl;
- cout<<"1. P maka Q"<<endl;
- cout<<"2. P maka R"<<endl;
- cout<<"3. P maka S"<<endl<<endl;
- cout<<"4. Q maka P"<<endl;
- cout<<"5. Q maka R"<<endl;
- cout<<"6. Q maka S"<<endl<<endl;
- cout<<"7. R maka P"<<endl;
- cout<<"8. R maka Q"<<endl;
- cout<<"9. R maka S"<<endl<<endl;
- cout<<"10. S maka P"<<endl;
- cout<<"11. S maka Q"<<endl;
- cout<<"12. S maka R"<<endl<<endl;
- cout<<"PILIH PROPOSISI: "; cin>>o;
- clrscr();
- switch(o)
- {
- case 1:
- {
- cout<<"---------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA IMPLIKASI ( --> ) P maka Q"<<endl;
- cout<<"---------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi P: "; cin>>p[x];
- }
- clrscr();
- cout<<"-------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI IMPLIKASI ( ---> )"<<endl;
- cout<<"-------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi Q: "; cin>>q[x];
- }
- clrscr();
- cout<<"-------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI IMPLIKASI ( ---> )"<<endl;
- cout<<"-------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(p[x] == 1 && q[x] == 1)
- {cout<<"P maka Q = "<<p[x]<<endl;}
- else if(p[x] == 1 && q[x] == 0)
- {cout<<"P maka Q = "<<q[x]<<endl;}
- else if(p[x] == 0 && q[x] == 1)
- {cout<<"P maka Q = "<<q[x]<<endl;}
- else if(p[x] == 0 && q[x] == 0)
- {cout<<"P maka Q = 1"<<endl;}
- }
- ;break;
- }
- case 2:
- {
- cout<<"--------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA IMPLIKASI ( -> ) P maka R"<<endl;
- cout<<"--------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi P: "; cin>>p[x];
- }
- clrscr();
- cout<<"-------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI IMPLIKASI ( ---> )"<<endl;
- cout<<"-------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi R: "; cin>>r[x];
- }
- clrscr();
- cout<<"-------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI IMPLIKASI ( ---> )"<<endl;
- cout<<"-------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(p[x] == 1 && r[x] == 1)
- {cout<<"P maka R = "<<p[x]<<endl;}
- else if(p[x] == 1 && r[x] == 0)
- {cout<<"P maka R = "<<r[x]<<endl;}
- else if(p[x] == 0 && r[x] == 1)
- {cout<<"P maka R = "<<r[x]<<endl;}
- else if(p[x] == 0 && r[x] == 0)
- {cout<<"P maka R = 1"<<endl;}
- };break;
- }
- case 3:
- {
- cout<<"--------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA IMPLIKASI ( -> ) P maka S"<<endl;
- cout<<"--------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi P: "; cin>>p[x];
- }
- clrscr();
- cout<<"-------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI IMPLIKASI ( ---> )"<<endl;
- cout<<"-------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi S: "; cin>>s[x];
- }
- clrscr();
- cout<<"-------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI IMPLIKASI ( ---> )"<<endl;
- cout<<"-------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(p[x] == 1 && s[x] == 1)
- {cout<<"P maka S = "<<p[x]<<endl;}
- else if(p[x] == 1 && s[x] == 0)
- {cout<<"P maka S = "<<s[x]<<endl;}
- else if(p[x] == 0 && s[x] == 1)
- {cout<<"P maka S = "<<s[x]<<endl;}
- else if(p[x] == 0 && s[x] == 0)
- {cout<<"P maka S = 1"<<endl;}
- };break;
- }
- case 4:
- {
- cout<<"--------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA IMPLIKASI ( -> ) Q maka P"<<endl;
- cout<<"--------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi Q: "; cin>>q[x];
- }
- clrscr();
- cout<<"-------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI IMPLIKASI ( ---> )"<<endl;
- cout<<"-------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi P: "; cin>>p[x];
- }
- clrscr();
- cout<<"-------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI IMPLIKASI ( ---> )"<<endl;
- cout<<"-------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(q[x] == 1 && p[x] == 1)
- {cout<<"Q maka P = "<<p[x]<<endl;}
- else if(q[x] == 1 && p[x] == 0)
- {cout<<"Q maka P = "<<p[x]<<endl;}
- else if(q[x] == 0 && p[x] == 1)
- {cout<<"Q maka P = "<<p[x]<<endl;}
- else if(q[x] == 0 && p[x] == 0)
- {cout<<"Q maka P = 1"<<endl;}
- }
- ;break;
- }
- case 5:
- {
- cout<<"--------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA IMPLIKASI ( -> ) Q maka R"<<endl;
- cout<<"--------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi Q: "; cin>>q[x];
- }
- clrscr();
- cout<<"-------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI IMPLIKASI ( ---> )"<<endl;
- cout<<"-------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi R: "; cin>>r[x];
- }
- clrscr();
- cout<<"-------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI IMPLIKASI ( ---> )"<<endl;
- cout<<"-------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(q[x] == 1 && r[x] == 1)
- {cout<<"Q maka R = "<<r[x]<<endl;}
- else if(q[x] == 1 && r[x] == 0)
- {cout<<"Q maka R = "<<r[x]<<endl;}
- else if(q[x] == 0 && r[x] == 1)
- {cout<<"Q maka R = "<<r[x]<<endl;}
- else if(q[x] == 0 && r[x] == 0)
- {cout<<"P maka R = 1"<<endl;}
- }
- ;break;
- }
- case 6:
- {
- cout<<"--------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA IMPLIKASI ( -> ) Q maka S"<<endl;
- cout<<"--------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi Q: "; cin>>q[x];
- }
- clrscr();
- cout<<"-------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI IMPLIKASI ( ---> )"<<endl;
- cout<<"-------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi S: "; cin>>s[x];
- }
- clrscr();
- cout<<"-------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI IMPLIKASI ( ---> )"<<endl;
- cout<<"-------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(q[x] == 1 && s[x] == 1)
- {cout<<"Q maka S = "<<s[x]<<endl;}
- else if(q[x] == 1 && s[x] == 0)
- {cout<<"Q maka S = "<<s[x]<<endl;}
- else if(q[x] == 0 && s[x] == 1)
- {cout<<"Q maka S = "<<s[x]<<endl;}
- else if(q[x] == 0 && s[x] == 0)
- {cout<<"Q maka S = 1"<<endl;}
- }
- ;break;
- }
- case 7:
- {
- cout<<"--------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA IMPLIKASI ( -> ) R maka P"<<endl;
- cout<<"--------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi R: "; cin>>r[x];
- }
- clrscr();
- cout<<"-------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI IMPLIKASI ( ---> )"<<endl;
- cout<<"-------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi P: "; cin>>p[x];
- }
- clrscr();
- cout<<"-------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI IMPLIKASI ( ---> )"<<endl;
- cout<<"-------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(r[x] == 1 && p[x] == 1)
- {cout<<"R maka P = "<<p[x]<<endl;}
- else if(r[x] == 1 && p[x] == 0)
- {cout<<"R maka P = "<<p[x]<<endl;}
- else if(r[x] == 0 && p[x] == 1)
- {cout<<"R maka P = "<<p[x]<<endl;}
- else if(r[x] == 0 && p[x] == 0)
- {cout<<"R maka P = 1"<<endl;}
- }
- ;break;
- }
- case 8:
- {
- cout<<"--------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA IMPLIKASI ( -> ) R maka Q"<<endl;
- cout<<"--------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi R: "; cin>>r[x];
- }
- clrscr();
- cout<<"-------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI IMPLIKASI ( ---> )"<<endl;
- cout<<"-------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi Q: "; cin>>q[x];
- }
- clrscr();
- cout<<"-------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI IMPLIKASI ( ---> )"<<endl;
- cout<<"-------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(r[x] == 1 && q[x] == 1)
- {cout<<"R maka Q = "<<q[x]<<endl;}
- else if(r[x] == 1 && q[x] == 0)
- {cout<<"R maka Q = "<<q[x]<<endl;}
- else if(r[x] == 0 && q[x] == 1)
- {cout<<"R maka Q = "<<q[x]<<endl;}
- else if(r[x] == 0 && q[x] == 0)
- {cout<<"R maka Q = 1"<<endl;}
- }
- ;break;
- }
- case 9:
- {
- cout<<"--------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA IMPLIKASI ( -> ) R maka S"<<endl;
- cout<<"--------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi R: "; cin>>r[x];
- }
- clrscr();
- cout<<"-------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI IMPLIKASI ( ---> )"<<endl;
- cout<<"-------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi S: "; cin>>s[x];
- }
- clrscr();
- cout<<"-------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI IMPLIKASI ( ---> )"<<endl;
- cout<<"-------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(r[x] == 1 && s[x] == 1)
- {cout<<"R maka S = "<<s[x]<<endl;}
- else if(r[x] == 1 && s[x] == 0)
- {cout<<"R maka S = "<<s[x]<<endl;}
- else if(r[x] == 0 && s[x] == 1)
- {cout<<"R maka S = "<<s[x]<<endl;}
- else if(r[x] == 0 && s[x] == 0)
- {cout<<"R maka S = 1"<<endl;}
- }
- ;break;
- }
- case 10:
- {
- cout<<"--------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA IMPLIKASI ( -> ) S maka P"<<endl;
- cout<<"--------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi S: "; cin>>s[x];
- }
- clrscr();
- cout<<"-------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI IMPLIKASI ( ---> )"<<endl;
- cout<<"-------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi P: "; cin>>p[x];
- }
- clrscr();
- cout<<"-------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI IMPLIKASI ( ---> )"<<endl;
- cout<<"-------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(s[x] == 1 && p[x] == 1)
- {cout<<"S maka P = "<<p[x]<<endl;}
- else if(s[x] == 1 && p[x] == 0)
- {cout<<"S maka P = "<<p[x]<<endl;}
- else if(s[x] == 0 && p[x] == 1)
- {cout<<"S maka P = "<<p[x]<<endl;}
- else if(s[x] == 0 && p[x] == 0)
- {cout<<"S maka P = 1"<<endl;}
- }
- ;break;
- }
- case 11:
- {
- cout<<"--------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA IMPLIKASI ( -> ) S maka Q"<<endl;
- cout<<"--------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi S: "; cin>>s[x];
- }
- clrscr();
- cout<<"-------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI IMPLIKASI ( ---> )"<<endl;
- cout<<"-------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi Q: "; cin>>q[x];
- }
- clrscr();
- cout<<"-------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI IMPLIKASI ( ---> )"<<endl;
- cout<<"-------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(s[x] == 1 && q[x] == 1)
- {cout<<"S maka Q = "<<q[x]<<endl;}
- else if(s[x] == 1 && q[x] == 0)
- {cout<<"S maka Q = "<<q[x]<<endl;}
- else if(s[x] == 0 && q[x] == 1)
- {cout<<"S maka Q = "<<q[x]<<endl;}
- else if(s[x] == 0 && q[x] == 0)
- {cout<<"S maka Q = 1"<<endl;}
- }
- ;break;
- }
- case 12:
- {
- cout<<"--------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA IMPLIKASI ( -> ) S maka R"<<endl;
- cout<<"--------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi S: "; cin>>s[x];
- }
- clrscr();
- cout<<"-------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI IMPLIKASI ( ---> )"<<endl;
- cout<<"-------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi R: "; cin>>r[x];
- }
- clrscr();
- cout<<"-------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI IMPLIKASI ( ---> )"<<endl;
- cout<<"-------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(s[x] == 1 && r[x] == 1)
- {cout<<"S maka R = "<<r[x]<<endl;}
- else if(s[x] == 1 && r[x] == 0)
- {cout<<"S maka R = "<<r[x]<<endl;}
- else if(s[x] == 0 && r[x] == 1)
- {cout<<"S maka R = "<<r[x]<<endl;}
- else if(s[x] == 0 && r[x] == 0)
- {cout<<"S maka R = 1"<<endl;}
- }
- ;break;
- }
- default:
- {
- cout<<"Maaf Entri Salah"<<endl;
- }
- }
- cout<<"\nKetik enter untuk melanjutkan !! "<<endl;
- }
- return 0;
- }
- biimplikasi()
- {
- {
- clrscr();
- int p[16], q[16], r[16], s[16];
- int o, x;
- cout<<"----------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI BIIMPLIKASI ( <---> )"<<endl;
- cout<<"----------------------------------------------"<<endl<<endl;
- cout<<"1. P jhj Q"<<endl;
- cout<<"2. P jhj R"<<endl;
- cout<<"3. P jhj S"<<endl;
- cout<<"4. Q jhj R"<<endl;
- cout<<"5. Q jhj S"<<endl;
- cout<<"6. R jhj S"<<endl<<endl;
- cout<<"PILIH PROPOSISI: "; cin>>o;
- clrscr();
- switch(o)
- {
- case 1:
- {
- cout<<"-----------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA BIIMPLIKASI ( <--> ) P jhj Q"<<endl;
- cout<<"-----------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi P: "; cin>>p[x];
- }
- clrscr();
- cout<<"----------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI BIIMPLIKASI ( <---> )"<<endl;
- cout<<"----------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi Q: "; cin>>q[x];
- }
- clrscr();
- cout<<"----------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI BIIMPLIKASI ( <---> )"<<endl;
- cout<<"----------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(p[x] == 1 && q[x] == 1)
- {cout<<"P jhj Q = "<<p[x]<<endl;}
- else if(p[x] == 1 && q[x] == 0)
- {cout<<"P jhj Q = "<<q[x]<<endl;}
- else if(p[x] == 0 && q[x] == 1)
- {cout<<"P jhj Q = "<<p[x]<<endl;}
- else if(p[x] == 0 && q[x] == 0)
- {cout<<"P jhj Q = 1"<<endl;}
- }
- ;break;
- }
- case 2:
- {
- cout<<"-----------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA BIIMPLIKASI ( <--> ) P jhj R"<<endl;
- cout<<"-----------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi P: "; cin>>p[x];
- }
- clrscr();
- cout<<"----------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI BIIMPLIKASI ( <---> )"<<endl;
- cout<<"----------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi R: "; cin>>r[x];
- }
- clrscr();
- cout<<"----------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI BIIMPLIKASI ( <---> )"<<endl;
- cout<<"----------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(p[x] == 1 && r[x] == 1)
- {cout<<"P jhj R = "<<p[x]<<endl;}
- else if(p[x] == 1 && r[x] == 0)
- {cout<<"P jhj R = "<<r[x]<<endl;}
- else if(p[x] == 0 && r[x] == 1)
- {cout<<"P jhj R = "<<p[x]<<endl;}
- else if(p[x] == 0 && r[x] == 0)
- {cout<<"P jhj R = 1"<<endl;}
- };break;
- }
- case 3:
- {
- cout<<"-----------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA BIIMPLIKASI ( <--> ) P jhj S"<<endl;
- cout<<"-----------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi P: "; cin>>p[x];
- }
- clrscr();
- cout<<"----------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI BIIMPLIKASI ( <---> )"<<endl;
- cout<<"----------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi S: "; cin>>s[x];
- }
- clrscr();
- cout<<"----------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI BIIMPLIKASI ( <---> )"<<endl;
- cout<<"----------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(p[x] == 1 && s[x] == 1)
- {cout<<"P jhj S = "<<p[x]<<endl;}
- else if(p[x] == 1 && s[x] == 0)
- {cout<<"P jhj S = "<<s[x]<<endl;}
- else if(p[x] == 0 && s[x] == 1)
- {cout<<"P jhj S = "<<p[x]<<endl;}
- else if(p[x] == 0 && s[x] == 0)
- {cout<<"P ^ S = 1"<<endl;}
- };break;
- }
- case 4:
- {
- cout<<"-----------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA BIIMPLIKASI ( <--> ) Q jhj R"<<endl;
- cout<<"-----------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi q: "; cin>>q[x];
- }
- clrscr();
- cout<<"----------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI BIIMPLIKASI ( <---> )"<<endl;
- cout<<"----------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi r: "; cin>>r[x];
- }
- clrscr();
- cout<<"----------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI BIIMPLIKASI ( <---> )"<<endl;
- cout<<"----------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(q[x] == 1 && r[x] == 1)
- {cout<<"Q jhj R = "<<q[x]<<endl;}
- else if(q[x] == 1 && r[x] == 0)
- {cout<<"Q jhj R = "<<r[x]<<endl;}
- else if(q[x] == 0 && r[x] == 1)
- {cout<<"Q jhj R = "<<q[x]<<endl;}
- else if(q[x] == 0 && r[x] == 0)
- {cout<<"Q ^ R = 1"<<endl;}
- };break;
- }
- case 5:
- {
- cout<<"-----------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA BIIMPLIKASI ( <--> ) Q jhj S"<<endl;
- cout<<"-----------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi q: "; cin>>q[x];
- }
- clrscr();
- cout<<"----------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI BIIMPLIKASI ( <---> )"<<endl;
- cout<<"----------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi s: "; cin>>s[x];
- }
- clrscr();
- cout<<"----------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI BIIMPLIKASI ( <---> )"<<endl;
- cout<<"----------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(q[x] == 1 && s[x] == 1)
- {cout<<"Q jhj S = "<<q[x]<<endl;}
- else if(q[x] == 1 && s[x] == 0)
- {cout<<"Q jhj S = "<<s[x]<<endl;}
- else if(q[x] == 0 && s[x] == 1)
- {cout<<"Q jhj S = "<<q[x]<<endl;}
- else if(q[x] == 0 && s[x] == 0)
- {cout<<"Q ^ S = 1"<<endl;}
- };break;
- }
- case 6:
- {
- cout<<"-----------------------------------------------------"<<endl;
- cout<<"PROGRAM PROPOSISI LOGIKA BIIMPLIKASI ( <--> ) R jhj S"<<endl;
- cout<<"-----------------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi r: "; cin>>r[x];
- }
- clrscr();
- cout<<"----------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI BIIMPLIKASI ( <---> )"<<endl;
- cout<<"----------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- cout<<"Masukan proposisi s: "; cin>>s[x];
- }
- clrscr();
- cout<<"----------------------------------------------"<<endl;
- cout<<"PROGRAM LOGIKA PROPOSISI BIIMPLIKASI ( <---> )"<<endl;
- cout<<"----------------------------------------------"<<endl<<endl;
- for(x=0;x<=15;x++)
- {
- if(r[x] == 1 && s[x] == 1)
- {cout<<"R jhj S = "<<r[x]<<endl;}
- else if(r[x] == 1 && s[x] == 0)
- {cout<<"R jhj S = "<<s[x]<<endl;}
- else if(r[x] == 0 && s[x] == 1)
- {cout<<"R jhj S = "<<r[x]<<endl;}
- else if(r[x] == 0 && s[x] == 0)
- {cout<<"R ^ S = 1"<<endl;}
- };break;
- }
- default:
- {
- cout<<"Maaf Entri Salah"<<endl;
- }
- }
- cout<<"Tekan Enter untuk melanjutkan !! "<<endl;
- }
- return 0;
- }
- about() {
- {
- clrscr();
- cout<<"======================================================="<<endl;
- cout<<"|\t Program Logika 4 Proposisi version 0.1 |"<<endl;
- cout<<"|\t COPYRIGHT 2012 |"<<endl;
- cout<<"|\t THIS PROGRAM CREATEED & DEVELOPED BY: |"<<endl<<endl;
- cout<<"|\t FAHRU ROJI (065111006) |"<<endl;
- cout<<"|\t FATHURRACHMAN (065111007) |"<<endl;
- cout<<"|\t ANGGA SAPUTRA (065111009) |"<<endl;
- cout<<"|\t MUHAMAD BANYU MUBAROK (065111028) |"<<endl<<endl;
- cout<<"|\t for more information, please free to ask : |"<<endl;
- cout<<"|\t banyumubarok@gmail.com / hidroid.blogspot.com |"<<endl;
- cout<<"======================================================="<<endl;
- }
- return 0;
- }
- void main()
- {
- int opt=0;
- while (opt!=1000)
- {
- clrscr();
- cout << "\t\t PROGRAM LOGIKA MATEMAIKA\n";
- cout << "\t\t 4 PROPOSISI\n";
- cout << "------------------------------------------------\n";
- cout << "|NO | PROPOSISI | SIMBOL | ISTILAH |\n";
- cout << "---------------------------- -------------------\n";
- cout << "| 1 | KONJUNGSI | ^ | DAN |\n";
- cout << "| 2 | DISJUNGSI | v | ATAU |\n";
- cout << "| 3 | IMPLIKASI | ---> | JIKA-MAKA |\n";
- cout << "| 4 | BIIMPLIKASI | <--> | JHJ |\n";
- cout << "| 5 | ABOUT | (!) | (!) |\n";
- cout << "----------------------------------------------\n\n";
- cout << " \t========================\n";
- cout << " \t MASUKAN PILIHAN: "; cin>>opt;
- cout << " \t========================\n";
- switch (opt)
- {
- case 1:
- {
- konjungsi();break;
- }
- case 2:
- {
- disjungsi();break;
- }
- case 3:
- {
- implikasi();break;
- }
- case 4:
- {
- biimplikasi();break;
- }
- case 5:
- {
- about();break;
- }
- default:
- {
- cout << " \t=================================\n";
- cout << " \t| MAAF ENTRI SALAH! |\n";
- cout << " \t=============================\n\n\n";
- }
- }
- getch();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement