Advertisement
Jordimario

Cerchio

Oct 26th, 2019
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package javaapplication5;
  7.  
  8. /**
  9. *
  10. * @author quartaaif
  11. */
  12. public class Cerchio {
  13. private double raggio;
  14. private double area;
  15. private double circonferenza;
  16.  
  17. public double setRaggio(double a){
  18. return this.raggio=a;
  19. }
  20.  
  21. public double area(){
  22. return area=(this.raggio * this.raggio * Math.PI);
  23. }
  24.  
  25.  
  26. public double circonferenza(){
  27. return this.circonferenza = 2 * Math.PI * this.raggio;
  28. }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement