主题:[讨论]求高手帮帮忙 明天就要交作业了 谢谢了~~~~~~~~~~~~~
#include<string>
#include<fstream>
#include<iostream>
using namespace std;
class shuju
{
public:
shuju(int year,int month,int day,double spxf,double fzfy,double znjy,double cxje,double qtzc,double shouru,double zcze,double szce);
setbill(int year,int month,int day,double spxf,double fzfy,double znjy,double sdfy,double ylfy,double qtzc,double cxje,double zcze,double shouru,double szce);
double setbill();
void display();
double show();
protected:
int year;
int month;
int day;
double spxf;
double fzfy;
double znjy;
double sdfy;
double ylfy;
double cxje;
double qtzc;
double shouru;
double zcze;
double szce;
};
shuju::setbill(int year,int month,int day,double spxf,double fzfy,double znjy,double sdfy,double ylfy,double qtzc,double cxje,double zcze,double shouru,double szce)
//年。月。日。食品消费。房租。子女教育。水电。医疗。储蓄。其它。支出总额。收入。收支差额。
{
year=year;
month=month;
day=day;
spxf=spxf;
fzfy=fzfy;
znjy=znjy;
sdfy=sdfy;
ylfy=ylfy;
cxje=cxje;
qtzc=qtzc;
shouru=shouru;
zcze=zcze;
szce=szce;
};
void shuju::display()
{
cout<<endl<<"year"<<year<<endl;
cout<<"month"<<month<<endl;
cout<<"day"<<day<<endl;
cout<<"spxf:"<<spxf<<endl;
cout<<"fzfy:"<<fzfy<<endl;
cout<<"znjy:"<<znjy<<endl;
cout<<"sdfy:"<<sdfy<<endl;
cout<<"ylfy:"<<ylfy<<endl;
cout<<"cxje:"<<cxje<<endl;
cout<<"qtzc:"<<qtzc<<endl;
cout<<"shouru:"<<shouru<<endl;
cout<<"zcze:"<<zcze<<endl;
cout<<"szce:"<<szce<<endl;
};
double shuju::show()
{
cin>>month;
cin>>day;
cin>>spxf;
cin>>fzfy;
cin>>znjy;
cin>>sdfy;
cin>>ylfy;
cin>>cxje;
cin>>qtzc;
cin>>shouru;
cin>>szce;
cin>>zcze;
zcze=spxf+fzfy+znjy+sdfy+ylfy+qtzc;
szce=zcze-shouru;
return(zcze);
return(szce);
};
int main()
{
shuju s1;
s1.display();
return 0;
}
#include<fstream>
#include<iostream>
using namespace std;
class shuju
{
public:
shuju(int year,int month,int day,double spxf,double fzfy,double znjy,double cxje,double qtzc,double shouru,double zcze,double szce);
setbill(int year,int month,int day,double spxf,double fzfy,double znjy,double sdfy,double ylfy,double qtzc,double cxje,double zcze,double shouru,double szce);
double setbill();
void display();
double show();
protected:
int year;
int month;
int day;
double spxf;
double fzfy;
double znjy;
double sdfy;
double ylfy;
double cxje;
double qtzc;
double shouru;
double zcze;
double szce;
};
shuju::setbill(int year,int month,int day,double spxf,double fzfy,double znjy,double sdfy,double ylfy,double qtzc,double cxje,double zcze,double shouru,double szce)
//年。月。日。食品消费。房租。子女教育。水电。医疗。储蓄。其它。支出总额。收入。收支差额。
{
year=year;
month=month;
day=day;
spxf=spxf;
fzfy=fzfy;
znjy=znjy;
sdfy=sdfy;
ylfy=ylfy;
cxje=cxje;
qtzc=qtzc;
shouru=shouru;
zcze=zcze;
szce=szce;
};
void shuju::display()
{
cout<<endl<<"year"<<year<<endl;
cout<<"month"<<month<<endl;
cout<<"day"<<day<<endl;
cout<<"spxf:"<<spxf<<endl;
cout<<"fzfy:"<<fzfy<<endl;
cout<<"znjy:"<<znjy<<endl;
cout<<"sdfy:"<<sdfy<<endl;
cout<<"ylfy:"<<ylfy<<endl;
cout<<"cxje:"<<cxje<<endl;
cout<<"qtzc:"<<qtzc<<endl;
cout<<"shouru:"<<shouru<<endl;
cout<<"zcze:"<<zcze<<endl;
cout<<"szce:"<<szce<<endl;
};
double shuju::show()
{
cin>>month;
cin>>day;
cin>>spxf;
cin>>fzfy;
cin>>znjy;
cin>>sdfy;
cin>>ylfy;
cin>>cxje;
cin>>qtzc;
cin>>shouru;
cin>>szce;
cin>>zcze;
zcze=spxf+fzfy+znjy+sdfy+ylfy+qtzc;
szce=zcze-shouru;
return(zcze);
return(szce);
};
int main()
{
shuju s1;
s1.display();
return 0;
}