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

Aluno #151 #151

Open
wants to merge 24 commits into
base: master
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
10 changes: 6 additions & 4 deletions Cliente.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
#include <string>
#include "Cliente.hpp"

using namespace std;

void Cliente::print(){

std::cout << " Nome: " << NOME << endl
<< " Endereço: " << endereco << endl
cout << " Nome: " << NOME << endl
<< " Endereço: " << ENDERECO << endl
<< " Cidade: " << CIDADE << endl
<< " Estado: " << ESTADO << endl
<< " CEP: " << cep << endl;
<< " CEP: " << CEP << endl;

}
}
9 changes: 3 additions & 6 deletions Cliente.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,17 @@
#define CLIENTE_H

#include <string>

using namespace std;

class Cliente{

public:

string NOME;
string endereco;
string CIDADE;
string ESTADO;
string cep;
string NOME, ENDERECO, CIDADE, ESTADO, CEP;

void print(); // imprime na tela os dados de um cliente cadastrado

};

#endif
#endif
25 changes: 13 additions & 12 deletions Encomenda.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,27 @@
#define Encomenda_H

#include "Cliente.hpp"

using namespace std;

class Encomenda{

public:

double PESO = 0.0;
double CUSTOkg = 0.0;
double T = 0.0;
Cliente remetente;
Cliente dest;
double CUSTOKG = 0.0;
double SOMATORIA = 0.0;
Cliente REMETENTE;
Cliente DEST;

void print(){
void Print(){

std::cout << "[Remetente]" << endl;
remetente.print();
std::cout << "[Destinatário]" << endl;
dest.print();
cout << "[Remetente]" << endl;
REMETENTE.Print();
cout << "[Destinatário]" << endl;
DEST.Print();

}
};

};

#endif
#endif
25 changes: 13 additions & 12 deletions EncomendaNormal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,30 @@

#include "Encomenda.hpp"
#include "Cliente.hpp"

using namespace std;

class EncomendaNormal: public Encomenda{

public:

double calcula(){
double Calcula(){

double x = PESO * CUSTOkg;
double CONTA = PESO * CUSTOKG;

return x;
return CONTA;

}

void print(){
void Print(){

Encomenda::print();
std::cout << "[Encomenda Normal]" << endl;
std::cout << " Peso: " << PESO << endl
<< " Custo por kg: " << CUSTOkg << endl
<< " Custo total: " << T << endl;
Encomenda::Print();
cout << "[Encomenda Normal]" << endl;
cout << " Peso: " << PESO << endl
<< " Custo por kg: " << CUSTOKG << endl
<< " Custo total: " << SOMATORIA << endl;

}
};

};

#endif
#endif
28 changes: 14 additions & 14 deletions EncomendaRelampago.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@

#include "Encomenda.hpp"
#include "Cliente.hpp"

using namespace std;

class EncomendaRelampago: public Encomenda{

public:

double calcula(){
double Calcula(){

double x = PESO * CUSTOkg;
x += x * 0.25;
return x;
double CONTA = PESO * CUSTOKG;
CONTA += CONTA * 0.25;

return CONTA;
}

void print(){
void Print(){

Encomenda::print();
std::cout << "[Encomenda Relâmpago]" << endl;
std::cout << " Peso: " << PESO << endl
<< " Custo por kg: " << CUSTOkg << endl
Encomenda::Print();
cout << "[Encomenda Relâmpago]" << endl;
cout << " Peso: " << PESO << endl
<< " Custo por kg: " << CUSTOKG << endl
<< " Taxa adicional: " << 0.25 << endl
<< " Custo total: " << T << endl;
<< " Custo total: " << SOMATORIA << endl;

}
};

};

#endif
#endif
Loading