Guest User

Untitled

a guest
Jun 18th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. !!!!!TESTE!!!!!!
  2. --------------------------------------------------------------------------------
  3. @Test(expected=Exception.class)
  4. public void testConstrutor() throws Exception {
  5. Circulo c3 = new Circulo(new Ponto2D(0,0), -0.001);
  6. }
  7.  
  8.  
  9. ================================================================================
  10. !!!!!!MEU CÓDIGO!!!!!!!
  11. --------------------------------------------------------------------------------
  12. public Circulo(Ponto2D ponto2D, double d) throws Exception{
  13. if((area < 0.0)){
  14. throw new Exception("nao pode ser negativo");
  15. }
  16. if(raio < 0.0){
  17. throw new Exception("nao pode ser negativo");
  18. }
  19. if(perimetro < 0.0){
  20. throw new Exception("nao pode ser negativo");
  21. }
  22. this.area = area;
  23. this.raio = d;
  24. this.perimetro = perimetro;
  25. this.centro = centro;
  26. }
Add Comment
Please, Sign In to add comment