SHOW:
|
|
- or go back to the newest paste.
| 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 | } |