Notes
Notes - notes.io |
using namespace std;
class ozelislem{
private:
int sayi1;
int sayi2;
int sayi3;
int sayi;
public:
void setislemler(int s1,int s2)
{
sayi1=s1;
sayi2=s2;
}
void setislemler2(int s1,int s2,int s3)
{
sayi1=s1;
sayi2=s2;
sayi3=s3;
}
void setfaktor(int say)
{
sayi=say;
}
int ebob()
{
int b,k;
if(sayi1>sayi2)
{
b=sayi1;
k=sayi2;
}
else
{
k=sayi1;
b=sayi2;
}
int bolen=k;
while(sayi1% bolen!=0||sayi2%bolen!=0)
{
bolen--;
}
return bolen;
}
int ebob2()
{
int b,k,o;
if(sayi1>sayi2 && sayi1>sayi3 && sayi2>sayi3)
{
b=sayi1;
k=sayi3;
o=sayi2;
}
else if(sayi1>sayi2 && sayi1>sayi3 && sayi2<sayi3)
{
b=sayi1;
k=sayi2;
o=sayi3;
}
else if(sayi2>sayi3 && sayi2>sayi3 && sayi1>sayi3)
{
b=sayi2;
k=sayi3;
o=sayi1;
}
else if(sayi2>sayi3 && sayi2>sayi3 && sayi1<sayi3)
{
b=sayi2;
k=sayi1;
o=sayi3;
}
else if(sayi3>sayi1 && sayi3>sayi2 && sayi1>sayi2)
{
b=sayi3;
k=sayi2;
o=sayi1;
}
else if(sayi3>sayi1 && sayi3>sayi2 && sayi2>sayi1)
{
b=sayi3;
k=sayi1;
o=sayi2;
}
int bolen=k;
while(sayi1% bolen!=0||sayi2%bolen!=0|| sayi3% bolen!=0)
{
bolen--;
}
return bolen;
}
int ekok()
{
int b,k;
if(sayi1>sayi2)
{
b=sayi1;
k=sayi2;
}
else
{
k=sayi1;
b=sayi2;
}
int kat=k;
while(kat% k!=0||kat%b!=0)
{
kat+=k;
}
return kat;
}
int ekok2()
{
int b,k,o;
if(sayi1>sayi2 && sayi1>sayi3 && sayi2>sayi3)
{
b=sayi1;
k=sayi3;
o=sayi2;
}
else if(sayi1>sayi2 && sayi1>sayi3 && sayi2<sayi3)
{
b=sayi1;
k=sayi2;
o=sayi3;
}
else if(sayi2>sayi3 && sayi2>sayi3 && sayi1>sayi3)
{
b=sayi2;
k=sayi3;
o=sayi1;
}
else if(sayi2>sayi3 && sayi2>sayi3 && sayi1<sayi3)
{
b=sayi2;
k=sayi1;
o=sayi3;
}
else if(sayi3>sayi1 && sayi3>sayi2 && sayi1>sayi2)
{
b=sayi3;
k=sayi2;
o=sayi1;
}
else if(sayi3>sayi1 && sayi3>sayi2 && sayi2>sayi1)
{
b=sayi3;
k=sayi1;
o=sayi2;
}
int kat = k;
while (kat % k != 0 || kat % b != 0 || kat% o!=0)
{
kat += k;
}
return kat;
}
int faktoriyel(int sayif)
{
int sonuc;
if (sayif == 1 || sayif == 0)
{
return 1;
}
else
{
sonuc=sayif*faktoriyel(sayif-1);
}
return sonuc;
}
int usalma()
{
int sonuc=1;
for(int i=1;i<=sayi2;i++)
{
sonuc*=sayi1;
}
return sonuc;
}
};
class dortislem{
private:
double sayi1;
double sayi2;
double sayi3;
public:
void setdortis(double s1,double s2)
{
sayi1=s1;
sayi2=s2;
}
void setdortis3(double s1,double s2,double s3)
{
sayi1=s1;
sayi2=s2;
sayi3=s3;
}
int toplama()
{
return sayi1+sayi2;
}
int toplama2()
{
return sayi1+sayi2+sayi3;
}
int cikarma()
{
return sayi1-sayi2;
}
int cikarma2()
{
return sayi1-sayi2-sayi3;
}
int carpma()
{
return sayi1*sayi2;
}
int carpma2()
{
return sayi1*sayi2*sayi3;
}
int bolme()
{
return sayi1/sayi2;
}
};
class Islemler{
private:
int tercih;
public:
Islemler()
{
tercih = 0;
}
void anablok() {
char islem,devam;
int say1,say2,say3;
int deger;
do{
cout<<"1) EBOB ALMA"<<endl;
cout<<"2) EKOK ALMA"<<endl;
cout<<"3) FAKTORIYEL ALMA"<<endl;
cout<<"4) US ALMA"<<endl;
cout<<"5) TOPLAMA"<<endl;
cout<<"6) CIKARMA"<<endl;
cout<<"7) CARPMA"<<endl;
cout<<"8) BOLME"<<endl;
cout<<"ISLEM NO GIRINIZ: ";
cin>>islem;
if(islem=='1'){
cout<<"KULLANACAGINIZ DEGER SAYISINI GIRIRNIZ(2/3): ";
cin>>deger;
if(deger==2)
{
cout<<"1.SAYIYI GIRINIZ: ";
cin>>say1;
cout<<"2.SAYIYI GIRINIZ: ";
cin>>say2;
ozelislem islem1;
islem1.setislemler(say1,say2);
cout<<"EBOB: "<<islem1.ebob()<<endl;
}
if(deger==3)
{
cout<<"1.SAYIYI GIRINIZ: ";
cin>>say1;
cout<<"2.SAYIYI GIRINIZ: ";
cin>>say2;
cout<<"3.SAYIYI GIRINIZ: ";
cin>>say3;
ozelislem islem1;
islem1.setislemler2(say1,say2,say3);
cout<<"EBOB: "<<islem1.ebob2()<<endl;
}
}
if(islem=='2'){
cout<<"KULLANACAGINIZ DEGER SAYISINI GIRIRNIZ(2/3): ";
cin>>deger;
if(deger==2)
{
cout<<"1.SAYIYI GIRINIZ: ";
cin>>say1;
cout<<"2.SAYIYI GIRINIZ: ";
cin>>say2;
ozelislem islem2;
islem2.setislemler(say1,say2);
cout<<"EKOK: "<<islem2.ekok()<<endl;
}
if(deger==3)
{
cout<<"1.SAYIYI GIRINIZ: ";
cin>>say1;
cout<<"2.SAYIYI GIRINIZ: ";
cin>>say2;
cout<<"3.SAYIYI GIRINIZ: ";
cin>>say3;
ozelislem islem2;
islem2.setislemler2(say1,say2,say3);
cout<<"EKOK: "<<islem2.ekok2()<<endl;
}
}
if(islem=='3'){
cout<<"SAYIYI GIRINIZ: ";
cin>>say1;
ozelislem islem3;
islem3.setfaktor(say1);
cout<<"FAKTORİYEL: "<<islem3.faktoriyel(say1)<<endl;
}
if(islem=='4'){
cout<<"SAYIYI GIRINIZ: ";
cin>>say1;
cout<<"US GIRINIZ: ";
cin>>say2;
ozelislem islem4;
islem4.setislemler(say1,say2);
cout<<"SONUC: "<<islem4.usalma()<<endl;
}
if(islem=='5'){
cout<<"KULLANACAGINIZ DEGER SAYISINI GIRIRNIZ(2/3): ";
cin>>deger;
if(deger==2)
{
cout<<"1.SAYIYI GIRINIZ: ";
cin>>say1;
cout<<"2.SAYIYI GIRINIZ: ";
cin>>say2;
dortislem islem5;
islem5.setdortis(say1,say2);
cout<<"SONUC: "<<islem5.toplama()<<endl;
}
else if(deger==3)
{
cout<<"1.SAYIYI GIRINIZ: ";
cin>>say1;
cout<<"2.SAYIYI GIRINIZ: ";
cin>>say2;
cout<<"3.SAYIYI GIRINIZ: ";
cin>>say3;
dortislem islem5;
islem5.setdortis3(say1,say2,say3);
cout<<"SONUC: "<<islem5.toplama2()<<endl;
}
else
{
cout<<"YANLIS VEYA EKSIK DEGER GIRDINIZ!";
}
}
if(islem=='6'){
cout<<"KULLANACAGINIZ DEGER SAYISINI GIRIRNIZ(2/3): ";
cin>>deger;
if(deger==2)
{
cout<<"1.SAYIYI GIRINIZ: ";
cin>>say1;
cout<<"2.SAYIYI GIRINIZ: ";
cin>>say2;
dortislem islem6;
islem6.setdortis(say1,say2);
cout<<"SONUC: "<<islem6.cikarma()<<endl;
}
else if(deger==3)
{
cout<<"1.SAYIYI GIRINIZ: ";
cin>>say1;
cout<<"2.SAYIYI GIRINIZ: ";
cin>>say2;
cout<<"3.SAYIYI GIRINIZ: ";
cin>>say3;
dortislem islem6;
islem6.setdortis3(say1,say2,say3);
cout<<"SONUC: "<<islem6.cikarma2()<<endl;
}
else
{
cout<<"YANLIS VEYA EKSIK DEGER GIRDINIZ!";
}
}
if(islem=='7'){
cout<<"KULLANACAGINIZ DEGER SAYISINI GIRIRNIZ(2/3): ";
cin>>deger;
if(deger==2)
{
cout<<"1.SAYIYI GIRINIZ: ";
cin>>say1;
cout<<"2.SAYIYI GIRINIZ: ";
cin>>say2;
dortislem islem7;
islem7.setdortis(say1,say2);
cout<<"SONUC: "<<islem7.carpma()<<endl;
}
else if(deger==3)
{
cout<<"1.SAYIYI GIRINIZ: ";
cin>>say1;
cout<<"2.SAYIYI GIRINIZ: ";
cin>>say2;
cout<<"3.SAYIYI GIRINIZ: ";
cin>>say3;
dortislem islem7;
islem7.setdortis3(say1,say2,say3);
cout<<"SONUC: "<<islem7.carpma2()<<endl;
}
else
{
cout<<"YANLIS VEYA EKSIK DEGER GIRDINIZ!";
}
}
if(islem=='8'){
cout<<"1.SAYIYI GIRINIZ: ";
cin>>say1;
cout<<"2.SAYIYI GIRINIZ: ";
cin>>say2;
dortislem islem8;
islem8.setdortis(say1,say2);
cout<<"SONUC: "<<islem8.bolme()<<endl;
}
cout<<"TEKRAR ISLEM GERCEKLESTIRMEK ISTIYOR MUSUNUZ?(e/h): ";
cin>>devam;
}while(devam=='E'||devam=='e');
}
};
int main()
{
Islemler sayfa;
sayfa.anablok();
return 0;
}
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team