Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6b79bbe346a7714a722340196f620294 #124

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 10 additions & 20 deletions Apartamento.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,24 @@ using namespace std;
class Apartamento : public Imovel {

public:

double valor() {

double v = AREA * VALORm2;
double comissao_apartamento = 0.04;

return v;

}

double comissao() {

double c = AREA * VALORm2;

return c * 0.04;

double comissao() override {
return area * VALORm2 * comissao_apartamento;
}

void print() {

std::cout << "[Apartamento]" << endl;
Imovel::print();
std::cout << "Area: " << AREA << endl
<< " Quartos: " << Q << endl
<< " Banheiros: " << B << endl
<< " Vagas: " << V << endl
<< "Taxa de Comissão: " << 4 << "%" << endl
<< "Valor Comissão: R$ " << fixed << setprecision(2) << C << endl
<< "Valor de Venda: R$ " << fixed << setprecision(2) << Valor << endl;
std::cout << "Area: " << area << endl;
std::cout << " Quartos: " << quartos << endl;
std::cout << " Banheiros: " << banheiros << endl;
std::cout << " Vagas: " << vagas << endl;
std::cout << "Taxa de Comissão: " << 4 << "%" << endl;
std::cout << "Valor Comissão: R$ " << fixed << setprecision(2) << taxa_comissao << endl;
std::cout << "Valor de Venda: R$ " << fixed << setprecision(2) << Valor << endl;
}
};

Expand Down
30 changes: 10 additions & 20 deletions Casa.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,23 @@ class Casa : public Imovel {

public:

double valor() {
double comissao_casa = 0.06;

double v = AREA * VALORm2;

return v;

}

double comissao() {

double c = AREA * VALORm2;

return c * 0.06;

double comissao() override {
return area * VALORm2 * comissao_casa;
}

void print() {

std::cout << "[Casa]" << endl;
Imovel::print();
std::cout << "Area: " << AREA << endl
<< " Quartos: " << Q << endl
<< " Banheiros: " << B << endl
<< " Vagas: " << V << endl
<< "Taxa de Comissão: " << 6 << "%" << endl
<< "Valor Comissão: R$ " << fixed << setprecision(2) << C << endl
<< "Valor de Venda: R$ " << fixed << setprecision(2) << Valor << endl;
std::cout << "Area: " << area << endl;
std::cout << " Quartos: " << quartos << endl;
std::cout << " Banheiros: " << banheiros << endl;
std::cout << " Vagas: " << vagas << endl;
std::cout << "Taxa de Comissão: " << 6 << "%" << endl;
std::cout << "Valor Comissão: R$ " << fixed << setprecision(2) << taxa_comissao << endl;
std::cout << "Valor de Venda: R$ " << fixed << setprecision(2) << Valor << endl;

}

Expand Down
16 changes: 7 additions & 9 deletions Cliente.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
#include <string>
#include "Cliente.hpp"

void Cliente::print(){

std::cout << " Nome: " << NOME << endl
<< " Telefone: " << telefone << endl
<< " Endereço: " << endereco << endl
<< " Cidade: " << CIDADE << endl
<< " Estado: " << UF << endl
<< " CEP: " << cep << endl;

void Pessoa::print(){
std::cout << " Nome: " << nome << endl;
std::cout << " Telefone: " << telefone << endl;
std::cout << " Endereço: " << endereco << endl;
std::cout << " Cidade: " << cidade << endl;
std::cout << " Estado: " << uf << endl;
std::cout << " CEP: " << cep << endl;
}
10 changes: 5 additions & 5 deletions Cliente.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
#include <string>
using namespace std;

class Cliente {
class Pessoa {
public:
string NOME;
string nome;
string endereco;
string CIDADE;
string UF;
string cidade;
string uf;
string cep;
string telefone;

void print();
};

Expand Down
30 changes: 10 additions & 20 deletions Cobertura.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,23 @@ class Cobertura : public Imovel {

public:

double valor() {
double comissao_cobertura = 0.1;

double v = AREA * VALORm2;

return v;

}

double comissao() {

double c = AREA * VALORm2;

return c * 0.10;

double comissao() override {
return area * VALORm2 * comissao_cobertura;
}

void print() {

std::cout << "[Cobertura]" << endl;
Imovel::print();
std::cout << "Area: " << AREA << endl
<< " Quartos: " << Q << endl
<< " Banheiros: " << B << endl
<< " Vagas: " << V << endl
<< "Taxa de Comissão: " << 10 << "%" << endl
<< "Valor Comissão: R$ " << fixed << setprecision(2) << C << endl
<< "Valor de Venda: R$ " << fixed << setprecision(2) << Valor << endl;
std::cout << "Area: " << area << endl;
std::cout << " Quartos: " << quartos << endl;
std::cout << " Banheiros: " << banheiros << endl;
std::cout << " Vagas: " << vagas << endl;
std::cout << "Taxa de Comissão: " << 10 << "%" << endl;
std::cout << "Valor Comissão: R$ " << fixed << setprecision(2) << taxa_comissao << endl;
std::cout << "Valor de Venda: R$ " << fixed << setprecision(2) << Valor << endl;
}
};

Expand Down
19 changes: 13 additions & 6 deletions Imovel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ using namespace std;

class Imovel {
public:
double AREA;
int Q;
int B;
int V;
double area;
int quartos;
int banheiros;
int vagas;
double VALORm2;
double Valor;
double C;
Cliente vendedor;
double taxa_comissao;
Pessoa vendedor;
string corretor;

void print() {
Expand All @@ -25,6 +25,13 @@ class Imovel {
cout << "[Corretor]" << endl;
cout << " " + corretor << endl;
}

double valor() {
return area * VALORm2;
}

virtual double comissao();

};

#endif
Loading