Created
March 10, 2013 15:57
-
-
Save arunenigma/5129112 to your computer and use it in GitHub Desktop.
cashregister.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // cashregister.cpp | |
| // cppbin | |
| // | |
| // Created by Arunprasath Shankar on 3/10/13. | |
| // Copyright (c) 2013 Arunprasath Shankar. All rights reserved. | |
| // | |
| #include "cashregister.h" | |
| CashRegister::CashRegister() | |
| { | |
| clear(); | |
| } | |
| void CashRegister::clear() { | |
| item_count = 0; | |
| total_price = 0; | |
| } | |
| void CashRegister::add_item(double price) { | |
| item_count ++; | |
| total_price = total_price + price; | |
| } | |
| double CashRegister::get_total() const { | |
| return total_price; | |
| } | |
| int CashRegister::get_count() const { | |
| return item_count; | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment