Advertisement
476179

OperatorPrecidenceAct2

Oct 1st, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. package activities;
  2.  
  3. public class AreaOfTriangle
  4. {
  5.  
  6. public static void main(String[] args)
  7. {
  8. double area, s, s1, s2, s3;
  9. s1 = 3;
  10. s2 = 4;
  11. s3 = 5;
  12. s = (s1+s2+s3)/2;
  13. area = Math.sqrt(s*(s-s2)*(s-s2)*(s-s3));
  14. System.out.println(area);
  15. //----------------------------------------------------------------
  16. double v,a,b,c, r = 10;
  17. v = 4.0/3*Math.PI*Math.pow(r,3);
  18.  
  19. System.out.println(v);
  20. //----------------------------------------------------------------
  21. double a, vi, vf, t;
  22. vf = 4;
  23. vi = 0;
  24. t = 1;
  25. a = (vf-vi)/t;
  26. System.out.println("acceleration: "+ a);
  27. }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement