当前位置: 首页 > news >正文

带做网站绿标网络推广专家

带做网站绿标,网络推广专家,直销公司管理系统,深圳台历制作在(1)的基础上进行改进 1:增加一个静态成员函数total,记录账户总金额和静态成员函数getTotal 2对不需要改变的对象进行const修饰 3多文件实现 account。h文件 #ifndef _ACCOUNT_ #define _ACCOUNT_ class SavingAccount {pri…

在(1)的基础上进行改进

1:增加一个静态成员函数total,记录账户总金额和静态成员函数getTotal

2对不需要改变的对象进行const修饰

3多文件实现

account。h文件

#ifndef _ACCOUNT_
#define _ACCOUNT_
class SavingAccount {private:int id;double rate;double balance;int lastdate;double accumulation;static double total;void record(int date, double amount);double accumulate(int date)const {return accumulation + balance * (date - lastdate);}
public:SavingAccount(int date, int id, double rate);int getid()const { return id; }double getbalance()const { return balance; }double getrate()const { return rate; }static double getTotal() { return total; }void deposit(int date, double amount);void withdraw(int date, double amount);void settle(int date);void show()const;
};
#endif

account。cpp文件

#include"account.h"
#include<cmath>
#include<iostream>
using namespace std;
double SavingAccount::total = 0;
SavingAccount::SavingAccount(int date, int id, double rate) :id(id), balance(0), rate(rate), lastdate(date)
, accumulation(0) {cout << date << "\t#" << id << "    " << endl;
}
void SavingAccount::record(int date, double amount) {accumulation = accumulate(date);lastdate = date;amount = floor(amount * 100 + 0.5) / 100;balance += amount;total += amount;cout << date << "\t#" << id << "\t" << amount << "\t" << balance << endl;
}
void SavingAccount::deposit(int date, double amount) {record(date, amount);
}
void SavingAccount::withdraw(int date, double amount) {if (amount > getbalance())cout << "余额不足" << endl;elserecord(date, -amount);
}
void SavingAccount::settle(int date) {double interest = accumulate(date) * rate / 365;if (interest != 0)record(date, interest);accumulation = 0;
}
void SavingAccount::show()const {cout << "#" << id << "\tbalance:" << balance;
}

1.cpp

#include"account.h"
#include<iostream>
using namespace std;
int main() {SavingAccount s1(1, 21325302, 0.0015);SavingAccount s2(1, 21325303, 0.0015);s1.deposit(5, 5000);s2.deposit(25, 10000);s1.deposit(45, 5500);s2.withdraw(60, 4000);s1.settle(90);s2.settle(90);s1.show();s2.show();}

http://www.dt0577.cn/news/20089.html

相关文章:

  • 代做毕设网站可信么北京百度竞价托管公司
  • 网站上的产品五星怎样做优化今天最新新闻
  • 网络工作室网站青岛网站建设与设计制作
  • 武汉成交型网站建设百度快照怎么使用
  • 成都企业网站建设方案北京网站推广机构
  • 网站建设要到公安seo基本概念
  • 2021半夜好用的网站百度推广开户费用标准
  • 外国做的中国动画视频网站爱站长工具
  • 网站运营做的是什么工作网络营销常用工具
  • 网站cms系统 开源框架培训机构管理系统
  • wordpress皮肤下载站域名备案查询站长工具
  • 网站获取访客qq 原理软文网
  • 男生女生做污事网站 localhost搜索引擎优化方案
  • 青岛建站通百度竞价品牌广告
  • 购物网站最近浏览怎么做外链购买交易平台
  • 广告公司年终总结win10优化
  • 创业做婚恋交友网站廊坊百度推广seo
  • 海外服务器ip免费陕西seo关键词优化外包
  • 重庆模板建站软件百度网站怎么优化排名靠前
  • wordpress文章字体修改为宋体企业网站优化哪家好
  • 网站软件有哪些代理推广
  • 网站主页制作教程班级优化大师手机版下载
  • 做pc端软件可以参考那些网站经典软文案例分析
  • 上海网站制作与推广4a广告公司
  • 江门网站建设价格手机网址大全123客户端下载
  • 做网站搜索推广点击率太低怎么办管理培训
  • 网站建设专员招聘平面设计培训费用一般是多少
  • 有做游戏广告的网站seo快速优化软件
  • 网站建设网址外链发布网站
  • 电子商务网站建设运营百度网站联系方式