📄 nighthours.cpp
字号:
//Nighthours.cpp
#include<iostream.h>
#include<stdlib.h>
#include<time.h>
#include"Counter.h"
#include"Np.h"
#include"Nighthours.h"
Nighthours::Nighthours(int t,double d,double a):Np(t,d)
{
counting(a);
}
double Nighthours::counting(double a)
{
actualityexpense=a;
finalexpense=dailydiscount*actualityexpense;
return finalexpense;
}
void Nighthours::upgrade(double f)
{
f=finalexpense;
char c;
int a;
srand(time(0));
a=rand()%100000;
if(f>=700) {cout<<"The Expenditure is over 700,"<<endl
<<"Would you please to aply for a Silver Member card:"<<endl
<<"Yes(y) or No(n)?"<<endl;
cin>>c;
switch(c)
{case'y':cout<<"Congratuations!You have been our Silver Member!";
cout<<"your new Silver Cardnumber is:"<<"8888"<<a<<endl;
break;
case'n':cout<<"Thank you!"<<endl;break;
};
}
else cout<<endl;
}
void Nighthours::print()const
{
Np::print();
cout<<"actualityexpense is:"<<actualityexpense<<endl;
cout<<"finalexpense is:"<<finalexpense<<endl;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -