这是钱能的C++教材
源代码在线查看: fixed.cpp
软件大小: |
7133 K |
上传用户: |
GreatMarxist |
|
|
关键词: |
教材
|
下载地址: |
免注册下载 普通下载
|
|
//fixed.cpp
#include "fixed.h"
#include
#include
#include
Fixed::Fixed(unsigned accNo, float balan)
:Savings(accNo, balan)
{
int interval;
cout cin >>interval;
switch(interval){
case 1: rate=1.05f; break;
case 3: rate=1.08f; break;
case 5: rate=1.1f; break;
default: rate=1.08f;
}
_strdate(validDay);
char strYear[3];
strcpy(strYear, &validDay[6]);
int intYear = atoi(strYear)+interval;
_itoa(intYear,strYear,10);
strcpy(&validDay[6], strYear);
}
bool Fixed::VerifyDate() const
{
char strToday[9];
_strdate(strToday);
return strcmp(strToday, validDay) >= 0;
}
void Fixed::Withdrawal(float amount)
{
if(balance){
balance *= (VerifyDate() ? rate : 1.01f);
Display();
balance=0;
}
}