Calculate.cs 851 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace ConsoleApp1
  7. {
  8. public class Calculate
  9. {
  10. public static double Sum(double x,double y)
  11. {
  12. return x + y;
  13. }
  14. public static double Subtraction(double x, double y)
  15. {
  16. return x - y;
  17. }
  18. public static double Multiplication(double x, double y)
  19. {
  20. return x * y;
  21. }
  22. public static double Division(double x, double y)
  23. {
  24. return x / y;
  25. }
  26. public static double Exponentiation(double x, double y)
  27. {
  28. double result = x;
  29. for(int i=1; i<= y;i++)
  30. {
  31. result = result * x;
  32. }
  33. return result;
  34. }
  35. }
  36. }