如下程序的输出结果是______。
include<iostream>
using namespace std;
class Wages{ //“工资”类
double base; //基本工资
double bonus; //奖金
double tax; //税金
public:
Wages(double CBase,double CBonus,doable CTax):
base(CBase),bonus(CBonus),tax(CTax){ }
double getPay( )const; //返回应付工资额
Wages operator+(Wages w)cons[; //重载加法
};
double Wages::getPay( )cons[{return base+bonus-tax;}
Wages Wages::operator+(Wages w)const{return Wages(base+w.base,bonus+w.bonus,tax+w.tax);}
int main( ){
Wages wl(2000,500,100),w2(5000,1000,300);
eout<<(wl+w2).getPay( )<<endl;
return 0;
}
[主观题]如下程序的输出结果是______。 include using namespace std; class Pet{ char nam如下程序的输出结果是______。include<iostream>using namespace std;class Pet{char name[10];public:Pet(char*nanle){strcpy(this->name,name);}const char*getName( )const{return name;}virtual void call(
[主观题]如下程序的输出结果是______。 include using namespace std; class pumpkin{ publ如下程序的输出结果是______。include<iostream>using namespace std;class pumpkin{public:pumpkin( ){++count;}~pumpkin( ){--eount;}static void total_count( ){cout<<count<<"pumpkin(s)"<<endl;}privat
[主观题]如下程序的输出结果是______。 include using namespace std; int funl(int x){retu如下程序的输出结果是______。include<iostream>using namespace std;int funl(int x){return++x;}int fun2(int&x){return++x;}int main( ){int x:1,y=2;Y=funl(fun2(x));cout<<x<<','<<y;return 0;}
[主观题]下面程序运行后输出的结果是()。 include using namespace std; class example{ const下面程序运行后输出的结果是[ ]。include <iostream>using namespace std;class example{const int m;public:example(int i):m(i){}void pr(){cout<<"m="<<m<<endl'}};int main(){example x(100);x.pr();retur
[单选题]如下程序的输出结果是includeincludeusing namespace std;class XCD{char*如下程序的输出结果是 #include<lostream> #include<cstring> using namespace std; class XCD{ char*a; int b; public: XCD(char*aa,int bB) { a=new char[strlen(aA) +1]; strcpy(a,aA) ; b=bb; } char*Geta( ){ret
[单选题]如下程序的输出结果是includeincludeusing namespace std;class CSum{int如下程序的输出结果是 #include<iostream> #include<iomanip> using namespace std; class CSum{ int x,y; public: CSum(int x0,int y0):X(x0),y(y0){ } friend ostream& operator<<(ostream& os,const CSum&a
[单选题]有如下程序 include include using namespace std; cla有如下程序 #include <iostream> #include <iomanip> using namespace std; class MyClass { public: MyClass() { cout<<'A'; } MyClass(char c){ cout<<c; } ~MyClass(){ cout<<'B'; } }; int main( ) { MyClass p1,*p
[单选题]执行如下程序后的输出结果是()。include include using namespace std;int ma执行如下程序后的输出结果是[ ]。include <iostream>include <fstream>using namespace std;int main ( ){char s[25];ofstream fl("data.txt");f1<<"C++ Programming";f1.close ();ifstream f2 ("data.txt");
[单选题]有如下的程序: include include using namespace st有如下的程序: #include<cstring> #include<iostream> using namespace std; class MyString { public: MyString(const char*s); ~MyString(){delete[]data;} Protected: unsigned len; char*data; }; MyString::MyString(const ch
[单选题]下列程序的输出结果是______。 include include using namespace std; voi下列程序的输出结果是______。include<iostream.h>include<string.h>using namespace std;void fun(const char*s,char &C) {c=s[strlen(s)/2];}int main(){char str[]="ABCDE";char ch=str[1];fun(str,ch);cout<<