Advertisement
mrScarlett

Untitled

Aug 30th, 2016
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. /**
  2. Create a new class called MathsSymbols
  3. Copy and paste this code into a new class and comment each line to explain what each maths function does.
  4.  
  5.  
  6. */
  7. public class MathsSymbols
  8. {
  9. public static void main (String[] args) {
  10. double a=Math.PI;
  11. double b=-90.8;
  12. int c=10;
  13. int d=2;
  14.  
  15. System.out.println('\f');
  16.  
  17. System.out.println(a);
  18. System.out.println(Math.sqrt(a));
  19. System.out.println(Math.abs(b));
  20. System.out.println(Math.ceil(a));
  21. System.out.println(Math.floor(a));
  22. System.out.println(Math.rint(a));
  23. System.out.println(Math.rint(b));
  24. System.out.println(Math.round(a));
  25. System.out.println(Math.round(b));
  26. System.out.println(Math.pow(c,d));
  27. System.out.println(Math.random());
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement