MathThings
This commit is contained in:
@ -61,5 +61,29 @@ public class Main {
|
|||||||
System.out.println("Movie: " + ticket.getMovie());
|
System.out.println("Movie: " + ticket.getMovie());
|
||||||
System.out.println("Row: " + ticket.getRow());
|
System.out.println("Row: " + ticket.getRow());
|
||||||
System.out.println("Seat: " + ticket.getSeat());
|
System.out.println("Seat: " + ticket.getSeat());
|
||||||
|
|
||||||
|
|
||||||
|
//The Math class:
|
||||||
|
int a = Math.abs(10);
|
||||||
|
System.out.println(a);
|
||||||
|
|
||||||
|
int b = Math.abs(-20);
|
||||||
|
System.out.println(b);
|
||||||
|
|
||||||
|
double c = Math.ceil(7.342);
|
||||||
|
System.out.println(c);
|
||||||
|
|
||||||
|
double f = Math.floor(7.343);
|
||||||
|
System.out.println(f);
|
||||||
|
|
||||||
|
int m = Math.max(10, 20);
|
||||||
|
System.out.println(m);
|
||||||
|
|
||||||
|
int m1 = Math.min(10, 20);
|
||||||
|
System.out.println(m1);
|
||||||
|
|
||||||
|
double p = Math.pow(2, 3);
|
||||||
|
System.out.println(p);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Binary file not shown.
Reference in New Issue
Block a user