savings_base.cpp
资源名称:c.rar [点击查看]
上传用户:puke2000
上传日期:2022-07-25
资源大小:912k
文件大小:1k
源码类别:
C#编程
开发平台:
Visual C++
- //=====================================
- // savings.cpp
- //=====================================
- #include<iostream>
- #include"savings_base.h"
- //-------------------------------------
- Savings::Savings(string acntNo, double balan)
- :acntNumber(acntNo), balance(balan){}
- //-------------------------------------
- void Savings::display()const{
- std::cout<<"Savings Account:"+acntNumber+" = "<<balance<<"n";
- }//------------------------------------
- void Savings::withdrawal(double amount){
- if(balance < amount)
- std::cout <<"Insufficient funds withdrawal: "<<amount<<"n";
- else
- balance -= amount;
- }//------------------------------------