Advertisement
Guest User

Teste Unitário

a guest
Nov 28th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.38 KB | None | 0 0
  1. <?php
  2. function calcula_parcela($total, $desconto, $parcelas)
  3. {
  4. $valor_parcela ($total - $desconto) / $parcelas; return $valor_parcela;
  5. }
  6. function testa_calcula_parcela()
  7. {
  8. print calcula_parcela(500, 200, 4) 75 ? ' OK 1 ' 'ERRO 1 ';
  9. print calcula_parcela(400, 100, 3) 100 ? ' OK 2 ' 'ERRO 2 ';
  10. print calcula_parcela(800, 50, 6) 125 ? ' OK 3 ' 'ERRO 3 ';
  11. }
  12. testa_calcula_parcela();
  13. ?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement