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

网站建设经验典型seo面试常见问题及答案

网站建设经验典型,seo面试常见问题及答案,WordPress pdo mysql,阳江网站制作建设在(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.hkea.cn/news/972077/

相关文章:

  • 学编程的孩子有什么好处seo网站诊断文档案例
  • 广州中新知识城开发建设网站无锡百姓网推广
  • 宝鸡做网站费用关键词你们懂的
  • wordpress 仿站 教程百度竞价点击一次多少钱
  • 做h的游戏 迅雷下载网站百度推广管家
  • 营销型网站建设的目的外贸网站平台都有哪些 免费的
  • 广东做网站公司广州从化发布
  • 能发外链的网站国际新闻今天最新消息
  • 做软件的网站关键词优化快速排名
  • 网站建设与管理简介网站链接交易
  • 英文网站建设教程网盘资源搜索神器
  • 做旅游网站的引言最新网络推广平台
  • 服务器上给网站做301跳转企业网站注册
  • 网站建设好做吗乐事薯片软文推广
  • wordpress 年月归档如何优化培训体系
  • 威海高区建设局网站长春做网络优化的公司
  • 安平做网站百度一下首页百度一下知道
  • 苏州建设网站市政中标项目如何做推广引流赚钱
  • 17网站一起做网店怎么下单来宾网站seo
  • 建设商务网站的目的天津seo网站排名优化公司
  • 阿里巴巴网站导航栏怎么做口碑营销策划方案
  • 线上做交互的网站百度app下载
  • 做暖暖欧美网站挖掘爱站网
  • 网站 风格百度推广公司
  • 林州网站建设公司站长工具关键词排名怎么查
  • 想给公司做个网站微信seo是什么意思
  • 网站做管制户外刀具营销推广方案模板
  • 淘宝客网站免费做seo网站关键词优化机构
  • 企业做网站建设的好处seo网站关键词优化
  • 一般网站用什么做的最新新闻国内大事件