Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- Create a new class called MathsSymbols
- Copy and paste this code into a new class and comment each line to explain what each maths function does.
- */
- public class MathsSymbols
- {
- public static void main (String[] args) {
- double a=Math.PI;
- double b=-90.8;
- int c=10;
- int d=2;
- System.out.println('\f');
- System.out.println(a);
- System.out.println(Math.sqrt(a));
- System.out.println(Math.abs(b));
- System.out.println(Math.ceil(a));
- System.out.println(Math.floor(a));
- System.out.println(Math.rint(a));
- System.out.println(Math.rint(b));
- System.out.println(Math.round(a));
- System.out.println(Math.round(b));
- System.out.println(Math.pow(c,d));
- System.out.println(Math.random());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement