Created
October 25, 2019 13:58
-
-
Save ilkermanap/1c977efc17885688cf742a22df6e2f1a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "evler.h" | |
#include <iostream> | |
using namespace std; | |
Ev::Ev() { | |
tipi = "Ev"; | |
} | |
Ev::Ev(uint oda_say) { | |
tipi = "Ev"; | |
oda_sayisi = oda_say; | |
} | |
void Ev::rapor() { | |
cout << "Tip " << this->tipi << endl; | |
cout << "Oda sayisi " << this->oda_sayisi << endl; | |
cout << "Bahce " << this->bahce << endl; | |
cout << "------------------------" << endl; | |
} | |
Ciftlik::Ciftlik() { | |
tipi = "Ciftlik"; | |
} | |
Ciftlik::Ciftlik(uint x) { | |
tipi = "Ciftlik"; | |
oda_sayisi = x; | |
} | |
Daire::Daire() { | |
tipi = "Daire"; | |
} | |
Daire::Daire(uint x) { | |
tipi = "Daire"; | |
oda_sayisi = x; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef EVLER_H | |
#define EVLER_H | |
#include <string> | |
typedef unsigned int uint; | |
using namespace std; | |
class Ev{ | |
public: | |
uint oda_sayisi; | |
float fiyat; | |
bool bahce=false; | |
bool teras; | |
bool havuz; | |
string tipi; | |
Ev(); | |
Ev(uint); // oda sayisi vererek | |
void rapor(); | |
}; | |
class Ciftlik : public Ev { | |
public: | |
Ciftlik(); | |
Ciftlik(uint); // oda sayisi ile | |
}; | |
class Daire : public Ev { | |
public: | |
Daire(); | |
Daire(uint); //oda sayisi ile | |
}; | |
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "evler.h" | |
int main() { | |
Ev ev(2); | |
Daire dr(4); | |
Ciftlik cf(8); | |
ev.rapor(); | |
dr.rapor(); | |
cf.rapor(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: | |
g++ -c evler.cpp -std=c++11 | |
g++ evler.o evmain.cpp -o evmain -std=c++11 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment