DarkSpect

Untitled

Feb 15th, 2012
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. int Associacao::total(int k, int total){
  2.     if(k<=l.comprimento()){
  3.         Donativo* aux;
  4.         l.encontra(k,aux);
  5.         if((typeid(*aux)==typeid(Dinheiro)){
  6.             total=total+(dynamic_cast<Dinheiro *>(aux)->getQuantia());
  7.         }else if((typeid(*aux)==typeid(Cheque)){
  8.             total=total+(dynamic_cast<Dinheiro *>(aux)->getMontante());
  9.         }
  10.         total=total(k+1,total);
  11.     }
  12.     return total;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment