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

28d6f84326ba2306decbab2b7c0222af #134

Open
wants to merge 16 commits 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
27 changes: 27 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
// Use o IntelliSense para saber mais sobre os atributos possíveis.
// Focalizar para exibir as descrições dos atributos existentes.
// Para obter mais informações, acesse: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Iniciar",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/sistema",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Habilitar a reformatação automática para gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
50 changes: 50 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"files.associations": {
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"new": "cpp",
"ostream": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"typeinfo": "cpp"
}
}
43 changes: 0 additions & 43 deletions Apartamento.hpp

This file was deleted.

45 changes: 0 additions & 45 deletions Casa.hpp

This file was deleted.

14 changes: 0 additions & 14 deletions Cliente.cpp

This file was deleted.

19 changes: 0 additions & 19 deletions Cliente.hpp

This file was deleted.

42 changes: 0 additions & 42 deletions Cobertura.hpp

This file was deleted.

30 changes: 0 additions & 30 deletions Imovel.hpp

This file was deleted.

33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
CC=g++
CFLAGS=-std=c++11 -Wall -lm
TARGET=sistema

BUILD_DIR = ./build
SRC_DIR = ./src
INCLUDE_DIR = ./include

${TARGET}: ${BUILD_DIR}/Cliente.o ${BUILD_DIR}/Imovel.o ${BUILD_DIR}/main.o ${BUILD_DIR}/Cobertura.o ${BUILD_DIR}/Apartamento.o ${BUILD_DIR}/Casa.o
${CC} ${CFLAGS} -o ${TARGET} ${BUILD_DIR}/*.o

${BUILD_DIR}/Cobertura.o: ${INCLUDE_DIR}/Cobertura.hpp ${SRC_DIR}/entidades/Cobertura.cpp
${CC} ${CFLAGS} -I ${INCLUDE_DIR}/ -c ${SRC_DIR}/entidades/Cobertura.cpp -o ${BUILD_DIR}/Cobertura.o

${BUILD_DIR}/Cliente.o: ${INCLUDE_DIR}/Cliente.hpp ${SRC_DIR}/entidades/Cliente.cpp
${CC} ${CFLAGS} -I ${INCLUDE_DIR}/ -c ${SRC_DIR}/entidades/Cliente.cpp -o ${BUILD_DIR}/Cliente.o

${BUILD_DIR}/Imovel.o: ${INCLUDE_DIR}/Imovel.hpp ${SRC_DIR}/entidades/Imovel.cpp
${CC} ${CFLAGS} -I ${INCLUDE_DIR}/ -c ${SRC_DIR}/entidades/Imovel.cpp -o ${BUILD_DIR}/Imovel.o

${BUILD_DIR}/Casa.o: ${INCLUDE_DIR}/Casa.hpp ${SRC_DIR}/entidades/Casa.cpp
${CC} ${CFLAGS} -I ${INCLUDE_DIR}/ -c ${SRC_DIR}/entidades/Casa.cpp -o ${BUILD_DIR}/Casa.o

${BUILD_DIR}/Apartamento.o: ${INCLUDE_DIR}/Apartamento.hpp ${SRC_DIR}/entidades/Apartamento.cpp
${CC} ${CFLAGS} -I ${INCLUDE_DIR}/ -c ${SRC_DIR}/entidades/Apartamento.cpp -o ${BUILD_DIR}/Apartamento.o

$(BUILD_DIR)/main.o : $(SRC_DIR)/main.cpp $(INCLUDE_DIR)/Apartamento.hpp $(INCLUDE_DIR)/Casa.hpp $(INCLUDE_DIR)/Cliente.hpp $(INCLUDE_DIR)/Cobertura.hpp $(INCLUDE_DIR)/Imovel.hpp
${CC} ${CFLAGS} -I ${INCLUDE_DIR}/ -c ${SRC_DIR}/main.cpp -o ${BUILD_DIR}/main.o

# Rule for cleaning files generated during compilation.
# Call 'make clean' to use it
clean:
rm ${BUILD_DIR}/*
Binary file added build/Apartamento.o
Binary file not shown.
Binary file added build/Casa.o
Binary file not shown.
Binary file added build/Cliente.o
Binary file not shown.
Binary file added build/Cobertura.o
Binary file not shown.
Binary file added build/Imovel.o
Binary file not shown.
Binary file added build/main.o
Binary file not shown.
19 changes: 19 additions & 0 deletions include/Apartamento.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#ifndef APARTAMENTO_HPP
#define APARTAMENTO_HPP

#include "Imovel.hpp"
#include "Cliente.hpp"

using namespace std;

class Apartamento : public Imovel {
public:
Apartamento(double area, int quartos, int banheiros, int vagas, double valor_m2, Cliente vendedor, string corretor);
double comissao() override;

void print() override;
private:
static constexpr double comissao_taxa = 0.04;
};

#endif
17 changes: 17 additions & 0 deletions include/Casa.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#ifndef CASA_HPP
#define CASA_HPP

#include "Imovel.hpp"
#include "Cliente.hpp"

class Casa : public Imovel {
public:
Casa(double area, int quartos, int banheiros, int vagas, double valor_m2, Cliente vendedor, string corretor);
double comissao() override;

void print() override;
private:
static constexpr double comissao_taxa = 0.06;
};

#endif
37 changes: 37 additions & 0 deletions include/Cliente.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#ifndef CLIENTE_HPP
#define CLIENTE_HPP

#include <string>
using namespace std;

class Cliente {
public:
Cliente(string nome, string endereco, string cidade, string uf, string cep, string telefone);
Cliente() {};

void print();

string get_nome();
string get_endereco();
string get_cidade();
string get_uf();
string get_cep();
string get_telefone();

void set_nome(string nome);
void set_endereco(string endereco);
void set_cidade(string cidade);
void set_uf(string uf);
void set_cep(string cep);
void set_telefone(string telefone);

private:
string _nome;
string _endereco;
string _cidade;
string _uf;
string _cep;
string _telefone;
};

#endif
Loading