Advertisement
Guest User

Untitled

a guest
Jun 26th, 2012
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. package com.scalabledevelopment.math;
  2.  
  3. public class Operations {
  4. public static int Add_Items = 1;
  5. public static int Subtract_Items = 2;
  6. public static int Multiple_Items = 3;
  7. public static int Divide_Items = 4;
  8. private int _val;
  9. //public int Operations = 1;
  10. public int getIntValue()
  11. {
  12. return _val;
  13. }
  14.  
  15. public void setIntValue(int val)
  16. {
  17. _val = val;
  18. }
  19. public static float staticadd ( float a, float b)
  20. {
  21. return ( a + b );
  22. }
  23.  
  24. public static int staticadd ( int a, int b)
  25. {
  26. return ( a + b );
  27. }
  28.  
  29. public static float staticmultiply ( float a, float b)
  30. {
  31. return ( a * b );
  32. }
  33.  
  34. public static float staticmultiplyfloat ( float a, float b)
  35. {
  36. return ( a * b );
  37. }
  38.  
  39. public static int staticmultiply ( int a, int b)
  40. {
  41. return ( a * b );
  42. }
  43.  
  44. public static float staticsub ( float a, float b)
  45. {
  46. return ( a - b );
  47. }
  48.  
  49. public static float staticoperate ( int op, float a, float b)
  50. {
  51. switch(op)
  52. {
  53. case (1):
  54. return (a + b );
  55. case (2):
  56. return (a - b);
  57. case (3):
  58. return (a * b);
  59. case (4):
  60. return (a / b);
  61. default:
  62. return 0f;
  63. }
  64. }
  65.  
  66. public int add(int a, int b)
  67. {
  68. return (a + b);
  69. }
  70.  
  71. public float add(float a, float b)
  72. {
  73. return (a + b);
  74. }
  75.  
  76. public float multiplyfloat( float a, float b)
  77. {
  78. return ( a * b );
  79. }
  80.  
  81. public float removeoperation ( int a, int b )
  82. {
  83. return ( a + b);
  84. }
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement