CoreAl.java 729B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import java.util.*;
  2. import java.util.Scanner;
  3. public class CoreAl
  4. {
  5. public double square(double number)
  6. {
  7. double sq=Math.pow(number,2);
  8. return sq;
  9. }
  10. //return square;
  11. public double squareroot(double number)
  12. {
  13. double sqroot=Math.sqrt(number);
  14. return sqroot;
  15. }
  16. public double exponent(double base,double power)
  17. {
  18. double exp=Math.pow(base,power);
  19. return exp;
  20. }
  21. public double inverse(double number)
  22. {
  23. return (1/number);
  24. }
  25. public double invertsign(double number)
  26. {
  27. return (number*-1);
  28. }
  29. }
  30. /*Catch(Exception e)
  31. {
  32. System.out.println("An error has occured");
  33. }*/