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

0d4597ff358e4286e261541f754bdf01 #118

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
38 changes: 8 additions & 30 deletions Apartamento.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,14 @@ using namespace std;

class Apartamento : public Imovel {

public:

double valor() {

double v = AREA * VALORm2;

return v;

}

double comissao() {

double c = AREA * VALORm2;

return c * 0.04;

}

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;
}
public:
void print()
{
Imovel::print("[Apartamento]", 4);
}

Apartamento(string corretor, double area, int quartos, int banheiros, int vagas, double valorm2)
: Imovel(move(corretor), area, quartos, banheiros, vagas, valorm2, (valorm2 * area), (valorm2 * area)*0.04){}
};

#endif
41 changes: 9 additions & 32 deletions Casa.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,15 @@ using namespace std;

class Casa : public Imovel {

public:

double valor() {

double v = AREA * VALORm2;

return v;

}

double comissao() {

double c = AREA * VALORm2;

return c * 0.06;

}

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;

}

public:
void print()
{
Imovel::print("[Casa]", 6);
}

Casa(string corretor, double area, int quartos, int banheiros, int vagas, double valorm2)
: Imovel(move(corretor), area, quartos, banheiros, vagas, valorm2, (valorm2 * area), (valorm2 * area)*0.06)
{}
};

#endif
17 changes: 8 additions & 9 deletions Cliente.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
#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 Cliente::print()
{
std::cout << " Nome: " << Nome << endl
<< " Telefone: " << Telefone << endl
<< " Endereço: " << Endereco << endl
<< " Cidade: " << Cidade << endl
<< " Estado: " << Estado << endl
<< " CEP: " << Cep << endl;
}
21 changes: 14 additions & 7 deletions Cliente.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,25 @@
#define CLIENTE_HPP

#include <string>
#include <utility>
using namespace std;

class Cliente {
public:
string NOME;
string endereco;
string CIDADE;
string UF;
string cep;
string telefone;
string Nome;
string Endereco;
string Cidade;
string Estado;
string Cep;
string Telefone;
void print();

protected:
Cliente(string nome, string endereco, string cidade, string estado, string cep, string telefone)
: Nome(move(nome)), Endereco(move(endereco)), Cidade(move(cidade)),
Estado(move(estado)), Cep(move(cep)), Telefone(move(telefone))
{}

void print();
};

#endif
16 changes: 16 additions & 0 deletions ClienteBeloHorizonte.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef CLIENTEBELOHORIZONTE_HPP
#define CLIENTEBELOHORIZONTE_HPP

#include <utility>

#include "Cliente.hpp"

class ClienteBeloHorizonte : public Cliente{
public:
ClienteBeloHorizonte(string nome, string endereco, string cep, string telefone)
: Cliente(std::move(nome), std::move(endereco),
"Belo Horizonte", "MG", std::move(cep), std::move(telefone)) {};
};


#endif
37 changes: 8 additions & 29 deletions Cobertura.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,14 @@ using namespace std;
class Cobertura : public Imovel {

public:

double valor() {

double v = AREA * VALORm2;

return v;

}

double comissao() {

double c = AREA * VALORm2;

return c * 0.10;

}

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;
}
void print()
{
Imovel::print("[Cobertura]", 10);
}

Cobertura(string corretor, double area, int quartos, int banheiros, int vagas, double valorm2)
: Imovel(move(corretor), area, quartos, banheiros, vagas, valorm2, (valorm2 * area), (valorm2 * area)*0.10)
{}
};

#endif
41 changes: 29 additions & 12 deletions Imovel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,38 @@ using namespace std;

class Imovel {
public:
double AREA;
int Q;
int B;
int V;
double VALORm2;
double Valor;
double C;
Cliente vendedor;
string corretor;
double Area;
int Quartos;
int Banheiros;
int Vagas;
double Valor_m2;
double ValorImovel;
double Comissao;
Cliente* Vendedor;
string Corretor;

void print() {
protected:
Imovel(string corretor, double area, int quartos, int banheiros, int vagas, double valorm2, double valorImovel, double comissao)
: Corretor(move(corretor)), Area(area), Quartos(quartos), Banheiros(banheiros), Vagas(vagas),
Valor_m2(valorm2), ValorImovel(valorImovel), Comissao(comissao)
{
this->Vendedor = nullptr;
}

void print(const string& tipo, int comissao)
{
cout << tipo << endl;
cout << "[Vendedor]" << endl;
vendedor.print();
Vendedor->print();
cout << "[Corretor]" << endl;
cout << " " + corretor << endl;
cout << " " + Corretor << endl
<< "Area: " << Area << endl
<< " Quartos: " << Quartos << endl
<< " Banheiros: " << Banheiros << endl
<< " Vagas: " << Vagas << endl
<< "Taxa de Comissão: " << comissao << "%" << endl
<< "valorVenda Comissão: R$ " << fixed << setprecision(2) << Comissao << endl
<< "valorVenda de Venda: R$ " << fixed << setprecision(2) << Comissao+ValorImovel << endl;
}
};

Expand Down
Loading