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

0f16c9aa2161ea16e181a8d1781bc048 #209

Open
wants to merge 36 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
ffc3ff1
Update Cliente.cpp
Chr1s-J Nov 28, 2023
441f486
Update Cliente.hpp
Chr1s-J Nov 28, 2023
dc689b4
Add files via upload
Chr1s-J Nov 28, 2023
3d2e455
Update Especialista.hpp
Chr1s-J Nov 28, 2023
bbba44e
Update Funcionario.hpp
Chr1s-J Nov 28, 2023
dffa868
Update Gerente.hpp
Chr1s-J Nov 28, 2023
3306882
Update Venda.hpp
Chr1s-J Nov 28, 2023
dab78e3
Create Makefile
Chr1s-J Nov 28, 2023
850534d
Update and rename Cliente.cpp to src/Cliente.cpp
Chr1s-J Nov 28, 2023
74226e6
Update and rename Especialista.cpp to src/Especialista.cpp
Chr1s-J Nov 28, 2023
2fd8822
Update and rename Funcionario.cpp to src/Funcionario.cpp
Chr1s-J Nov 28, 2023
d082d78
Update and rename Gerente.cpp to src/Gerente.cpp
Chr1s-J Nov 28, 2023
6a65c35
Update and rename Venda.cpp to src/Venda.cpp
Chr1s-J Nov 28, 2023
a00808a
Update and rename main.cpp to src/main.cpp
Chr1s-J Nov 28, 2023
7a91f0a
Update and rename Cliente.hpp to include/Cliente.hpp
Chr1s-J Nov 28, 2023
6cb5a28
Update and rename Funcionario.hpp to include/Funcionario.hpp
Chr1s-J Nov 28, 2023
db42496
Update and rename Gerente.hpp to include/Gerente.hpp
Chr1s-J Nov 28, 2023
40cf2b4
Update and rename Especialista.hpp to include/Especialista.hpp
Chr1s-J Nov 28, 2023
34cd1e3
Update and rename Venda.hpp to include/Venda.hpp
Chr1s-J Nov 28, 2023
0c846d6
Create .gitkeep for Empty Folder
Chr1s-J Nov 28, 2023
35cee24
Update Gerente.cpp
Chr1s-J Nov 28, 2023
e2315b0
Update Cliente.hpp
Chr1s-J Nov 28, 2023
8d3770e
Update Gerente.hpp
Chr1s-J Nov 28, 2023
c7c3928
Update main.cpp
Chr1s-J Nov 29, 2023
170754f
Update Cliente.hpp
Chr1s-J Nov 29, 2023
16b83fb
Update Cliente.cpp
Chr1s-J Nov 29, 2023
5cb83cc
Update Especialista.hpp
Chr1s-J Nov 29, 2023
95a3757
Update Funcionario.hpp
Chr1s-J Nov 29, 2023
cae63fe
Update Gerente.hpp
Chr1s-J Nov 29, 2023
92bce15
Update Venda.hpp
Chr1s-J Nov 29, 2023
866a34e
Update Funcionario.hpp
Chr1s-J Nov 29, 2023
0c9df18
Update Especialista.cpp
Chr1s-J Nov 29, 2023
4181e99
Update Funcionario.cpp
Chr1s-J Nov 29, 2023
0874d78
Update Gerente.cpp
Chr1s-J Nov 29, 2023
31f949f
Update main.cpp
Chr1s-J Nov 29, 2023
b0d3873
Update main.cpp
Chr1s-J Nov 29, 2023
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
13 changes: 0 additions & 13 deletions Cliente.cpp

This file was deleted.

20 changes: 0 additions & 20 deletions Cliente.hpp

This file was deleted.

39 changes: 0 additions & 39 deletions Especialista.hpp

This file was deleted.

27 changes: 0 additions & 27 deletions Funcionario.hpp

This file was deleted.

37 changes: 0 additions & 37 deletions Gerente.hpp

This file was deleted.

19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
CXX = g++
CFLAGS = -std=c++17 -Wall
SRC_DIR = src
OBJ_DIR = obj
INCLUDE_DIR = include

SRCS = $(wildcard $(SRC_DIR)/*.cpp)
OBJS = $(patsubst $(SRC_DIR)/%.cpp, $(OBJ_DIR)/%.o, $(SRCS))

all: vpl_execution

vpl_execution: $(OBJS)
$(CXX) $(CFLAGS) -o $@ $^

$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
$(CXX) $(CFLAGS) -I$(INCLUDE_DIR) -c -o $@ $<

clean:
rm -f $(OBJ_DIR)/*.o vpl_execution
42 changes: 0 additions & 42 deletions Venda.hpp

This file was deleted.

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

#include <string>

class Cliente{

std::string _nome;
std::string _endereco;
std::string _cep;

public:

void print();

Cliente (std::string nome, std::string cep, std::string endereco) : _nome(nome), _cep(cep), _endereco(endereco) {}

std::string getNome() {
return _nome;
}

std::string getEndereco() {
return _endereco;
}

std::string getCep() {
return _cep;
}

};

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

#include "Funcionario.hpp"

class Especialista : public Funcionario {

public:
std::string especialidade;

double comissao(double valorVenda);

void print();
};

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

#include <iostream>
#include <iomanip>

class Funcionario {

public:

double salarioBase; // valor mínimo recebido pelo funcionário
std::string idade;
std::string nome;
int rgFuncionario;

void print();

};

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

#include <iostream>
#include <iomanip>

#include "Funcionario.hpp"

class Gerente : public Funcionario {

public:

double bonificacao;

void print();

double calculaBonificacaoGerente(int numTotalVendas);

};

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

#include "Funcionario.hpp"
#include "Cliente.hpp"
#include "Especialista.hpp"

class Venda{

public:
double valor;
std::string descricao;
Especialista esp;
std::string cliente;

void print();

};

#endif
1 change: 1 addition & 0 deletions obj/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

12 changes: 12 additions & 0 deletions src/Cliente.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <iostream>

#include "Cliente.hpp"

void Cliente::print(){

std::cout << "[Cliente]" << std::endl
<< " Nome: " << getNome() << std::endl
<< " Endereco: " << getEndereco() << std::endl
<< " CEP: " << getCep() << std::endl;

}
19 changes: 19 additions & 0 deletions src/Especialista.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <iostream>

#include "Especialista.hpp"

double percentualComissao = 0.1;

double Especialista::comissao(double valorVenda) {
return valorVenda * percentualComissao;
}


void Especialista::print() {

std::cout << "[Especialista]" << std::endl;
Funcionario::print();
std::cout << " Nome: " << nome << std::endl
<< " SalarioBase: R$ " << std::fixed << std::setprecision(2) << salarioBase << std::endl;

}
9 changes: 9 additions & 0 deletions src/Funcionario.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <iostream>

#include "Funcionario.hpp"

void Funcionario::print() {
std::cout << "[Funcionario]" << std::endl
<< " Idade: " << idade << std::endl
<< " RGFunc: " << rgFuncionario << std::endl;
}
18 changes: 18 additions & 0 deletions src/Gerente.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <iostream>

#include "Gerente.hpp"

void Gerente::print() {
std::cout << "[Funcionario]" << std::endl
<< "[Gerente]" << std::endl
<< " Nome: " << nome << std::endl
<< " Idade: " << idade << std::endl
<< " RGFunc: " << rgFuncionario << std::endl
<< " SalarioBase: R$ " << std::fixed << std::setprecision(2) << salarioBase << std::endl;
}

double ValorBonificacao = 15.0;

double Gerente::calculaBonificacaoGerente(int numTotalVendas){
return numTotalVendas * ValorBonificacao;
}
10 changes: 10 additions & 0 deletions src/Venda.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <iostream>

#include "Venda.hpp"

void Venda::print() {

std::cout << "Especialista: " << esp.nome << std::endl
<< " Cliente: " << cliente << std::endl;

}
Loading