EricJohnson

calc_functions

Apr 4th, 2012
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.12 KB | None | 0 0
  1. //Eric Johnson
  2. //Multiply function
  3. //03-27-12
  4. #ifndef GLIBCXX_IOSTREAM
  5. #include <iostream>
  6. #endif
  7. #include <cmath>
  8. #include "menu.hpp"
  9.  
  10. using namespace std;
  11. double a, b, answer;
  12. //multiply function
  13. double multiply(double a, double b)
  14. {
  15.     double answer = a * b;
  16.     return answer;
  17.     //calls the menu function
  18.     //menu(a,b,answer,operation,again);
  19. }
  20.  
  21. //subtract function
  22. double subtract(double a, double b)
  23. {
  24.     double answer = a - b;
  25.     return answer;
  26.     //menu(a,b,answer,operation,again);
  27. }
  28.  
  29. //divide function
  30. double divide(double a, double b)
  31. {
  32.     double answer = a / b;
  33.     return answer;
  34.     //menu(a,b,answer,operation,again);
  35. }
  36. //b to the a power function
  37. double BtoA(double a, double b)
  38. {
  39.     double answer = pow(b,a);
  40.     return answer;
  41.     //menu(a,b,answer,operation,again);
  42. }
  43.  
  44. //a to the b power function
  45. double AtoB(double a, double b)
  46. {
  47.     double answer = pow(a,b);
  48.     return answer;
  49.     //menu(a,b,answer,operation,again);
  50. }
  51.  
  52. //add function
  53. double add(double a, double b)
  54. {
  55.     double answer = a+b;
  56.     return answer;
  57.     //menu(a,b,answer,operation,again);
  58. }
Advertisement
Add Comment
Please, Sign In to add comment