New to C++ Help Change from Purchase/Date Class

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

30 Replies - 1293 Views - Last Post: 03 September 2013 - 09:05 PM Rate Topic: -----

#31 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 3485
  • View blog
  • Posts: 10,742
  • Joined: 05-May 12

Re: New to C++ Help Change from Purchase/Date Class

Posted 03 September 2013 - 09:05 PM

Yes. One of the principles of good design is the single responsibility principle. If you can make the code that computes change only compute change, that would be better. (It can then just simply return an error or throw an exception for the cases when the payment is less than the cost.)
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3