Commit 632a1ade authored by Samuel Oliveira's avatar Samuel Oliveira

Adicionando aula 2

parent 5a2dfcf8
#include <string>
using namespace std;
class Cliente{
public:
string nome;
string cpf;
};
\ No newline at end of file
#include "conta.hpp"
void Conta::saca(double valor){
this->saldo -= valor;
}
void Conta::deposita(double valor){
this->saldo += valor;
}
void Conta::transfere(double valor, Conta &c){
this->saldo -= valor;
c.deposita(valor);
}
\ No newline at end of file
#include "cliente.hpp"
class Conta{
public:
int numero;
Cliente titular;
double saldo;
void saca(double valor);
void deposita(double valor);
void transfere(double valor, Conta &c);
};
\ No newline at end of file
#include <iostream>
#include "conta.hpp"
using namespace std;
int main(){
Conta c;
c.titular.nome = "José";
c.titular.cpf = "000.000.000-00";
cout << "Nome do titular da conta: " << c.titular.nome << endl;
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment