-
Notifications
You must be signed in to change notification settings - Fork 0
/
Banco.cpp
45 lines (45 loc) · 1.21 KB
/
Banco.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <iostream>
#include "Banco.h"
using namespace std;
Banco::Banco(vector <Cliente*> clientes,vector <Conta*> contas,vector <Transferencia*> transferencias)
{
this->clientes=clientes;
this->contas=contas;
this->transferencias=transferencias;
}
void Banco::saldoDoCliente(int cpf){
for(int i=0;i<clientes.size();i++){
if(clientes[i]->getCPF()==cpf){
saldoDaConta(clientes[i]);
}
}
}
void Banco::saldoDaConta(Cliente *cliente){
for(int i=0;i<contas.size();i++){
if(contas[i]->getCliente()==cliente){
contas[i]->imprimeSaldo();
}
}
}
int Banco::mostraValores(){
int total=0;
for(int i=0;i<contas.size();i++){
total+=contas[i]->getSaldo();
}
return total;
}
void Banco::listaClientes(){
for(int i=0;i<clientes.size();i++){
cout<<"Cliente "<<i+1<<endl;
cout<<"Nome:"<<clientes[i]->getNome()<<endl;
}
}
void Banco::listaContas(Cliente *cliente){
int cpf=cliente->getCPF();
cout<<"Nome do proprietario:"<<cliente->getNome();
for(int i=0;i<contas.size();i++){
if(contas[i]->getCliente()->getCPF()==cpf){
cout<<"Numero da conta:"<<contas[i]->getNumero()<<endl;
}
}
}