CPP   19

calculator.cpp

Guest on 30th June 2022 02:28:26 AM

  1. //----------+----------+----------+----------+-----------
  2. // File Name: calculator.cpp
  3. // Author: Guruansh Singh
  4.  // file for calculator.h.
  5. //                       Auxillary file that helps demonstrate the usage of a Makefile.
  6. //      Adapted from an example in a previous offering of CS 260.
  7. //----------+----------+----------+----------+-----------
  8. #include "calculator.h"
  9.  
  10. //-------------+---------------+-----------------+---------------+
  11. // @desc        Construct a calculator object
  12. // @param       int
  13. // @param       int
  14.  
  15. //-------------+---------------+-----------------+---------------+
  16. Calculator::Calculator(int x, int y)
  17. {
  18.         x_ = x;
  19.         y_ = y;
  20. }
  21.  
  22. //-------------+---------------+-----------------+---------------+
  23. // @desc        Calculates the sum of the two operands
  24. // @param       Calculator
  25. //-------------+---------------+-----------------+---------------+
  26. int Calculator::Sum()
  27. {
  28.         return x_ + y_;
  29. }

Raw Paste


Login or Register to edit or fork this paste. It's free.