Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "tglass.h"
- TGlass::TGlass(double capacity_cc){
- _capacity=capacity_cc;
- _amount=0.0;
- }
- void TGlass::PourLiquid(double cc){
- _amount=_amount+cc;
- if(_amount>_capacity) _amount=_capacity;
- }
- void TGlass::Drink(double cc){
- _amount=_amount-cc;
- if(_amount<0) _amount=0;
- }
- double TGlass::GetRemaining(){
- return _amount;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement