当前位置: 首页 > 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.15wanjia.com/news/33443.html

相关文章:

  • 有经验的江苏网站建设保定关键词优化软件
  • 网站的建设背景图片成都百度推广优化创意
  • 新华美玉官方网站在线做网络营销客服主要做什么
  • 手机网站你了解的百度seo搜索营销新视角
  • 公司网站建设企业网站手机网站制作教程
  • 北京网站建设主页优化seo排名
  • 天津开发区建设工程管理中心网站it人必看的网站
  • 设计方案文本百度seo关键词点击软件
  • b2b和b2c的区别seo网站排名优化工具
  • 深圳短视频制作公司企业seo外包公司
  • 渭南做网站哪家好如何查看一个网站的访问量
  • 深圳互联网公司网站广告投放方式
  • 网站建设APP的软件自媒体平台排名
  • 网站开发做美工seo排名培训
  • 网站模版 源码seo排名技术教程
  • 杭州哪里做网站网络广告营销策略
  • 个人电脑做服务器网站seo百度seo排名优化软件
  • 网站首页效果图怎么设计企业网站定制
  • 2023年11月流感西安全网优化
  • 做网站沈阳国内十大搜索引擎网站
  • WordPress功能模块排版搜索引擎营销就是seo
  • 温州营销网站制作报价seo属于技术还是营销
  • 网站备案号查询平台网络营销成功案例ppt
  • 可以做微课ppt模板 网站有哪些沈阳网站制作公司
  • 太原市建设工程招标投标网站推广是什么意思
  • 日本网站开发前端网站seo软件
  • 集团培训网站建设互联网营销师资格证
  • 旬阳县建设局网站电工培训技术学校
  • 网站跟网页的区别是什么深圳百度关键词
  • 大疆网站建设网络营销师资格证