文件名称:savingaccount
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:698byte
-
已下载:1次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
设计一个类SavingsAccount,定义一个静态数据成员记录存款的年利率(rate),该类的每个成员都包含一个私有的数据成员balance,表示该成员当前的存款数额。提供一个成员函数CalMonthlyInterest(),用以计算月利息(用balance乘以rate再除以12),并将这个月利息加入balance中。提供一个静态成员函数ModifyRate(),用以改变静态数据成员rate的值。定义两个不同的SavingsAccount对象saver1和saver2,当前存款数额balance分别为2000.00和3000.00。首先将rate设置为3 ,计算每个存款人的月息并打印新的结果,然后将rate设置为4 ,再次计算每个存款人的月息并打印新的结果。-Design a class SavingsAccount, define a static data member records of deposits interest rate (rate), every member of the class contains a private data member balance, said the members of the current deposit amount. A member function CalMonthlyInterest (), to calculate the monthly interest (rate multiplied with the balance divided by 12), and this month joined the balance of interest. Provide a static member function ModifyRate (), used to change the value of the static data member rate. SavingsAccount define two different objects saver1 and saver2, the current deposit balance amount of 2000.00 and 3000.00, respectively. First, the rate is set to 3 monthly interest rate calculated for each depositor and print new results, and then rate is set to 4 , re-calculate the monthly interest of each depositor and print new results.
相关搜索: SavingsAccount
(系统自动生成,下载前可以参看下载内容)
下载文件列表
main.cpp
SavingsAccount.cpp
SavingsAccount.h
SavingsAccount.cpp
SavingsAccount.h
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.