Last active
January 17, 2017 15:31
-
-
Save gabrielcesar/19f082ed565e7cb1bb2d9a966b4848ce to your computer and use it in GitHub Desktop.
Revisions
-
gabrielcesar revised this gist
Jan 17, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -48,4 +48,4 @@ int main ( void ) cout << "Diretor: " << diretor.calcularVendas () << endl; return 0; } -
gabrielcesar revised this gist
Jan 17, 2017 . No changes.There are no files selected for viewing
-
gabrielcesar created this gist
Jan 17, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,51 @@ #include <iostream> using namespace std; class Pessoa { public: int calcularVendas () { int valorUnitario = 0; int produtosVendidos = 0; return valorUnitario * produtosVendidos; } }; class Vendedor:public Pessoa { public: int calcularVendas() { int valorUnitario = 50; int produtosVendidos = 1500; return valorUnitario * produtosVendidos; } }; class Diretor:public Pessoa { public: int calcularVendas() { int valorUnitario = 150; int produtosVendidos = 3800; int taxaAdicional = 100; return taxaAdicional + (valorUnitario * produtosVendidos); } }; int main ( void ) { Pessoa pessoa; Vendedor vendedor; Diretor diretor; cout << "VENDAS " << endl; cout << "Pessoa: " << pessoa.calcularVendas () << endl; cout << "Vendedor: " << vendedor.calcularVendas () << endl; cout << "Diretor: " << diretor.calcularVendas () << endl; return 0; }