下列程序的执行结果为________。
#include<iostream.h>
class Point
{
public:
Point(double i,double j){x=i;y=j;}
double Area( )const{return 0.0;}
private:
double x,y;
};
class Rectangle:public Point
{
public:
Rectangle(double i,double J,double k,double 1);
double Area( )const(return w*h;}
private:
double w,h;
};
Rectangle::Rectangle(double i,double j,double k,double 1):Point(i,j)
{
w=k;h=l;
}
void fun(Point&s)
{
cout<<s.Area( )<<endl;
}
void main( )
{
Rectangle rec(3.0,5.2,15.0,25.0);
fun(rec);
}
题库:计算机等级考试
类型:填空题
时间:2017-07-03 17:39:19
免费下载:《填空》Word试卷
下列程序的执行结果为________。
#include<iostream.h>
class Point
{
public:
Point(double i,double j){x=i;y=j;}
double Area( )const{return 0.0;}
private:
double x,y;
};
class Rectangle:public Point
{
public:
Rectangle(double i,double J,double k,double 1);
double Area( )const(return w*h;}
private:
double w,h;
};
Rectangle::Rectangle(double i,double j,double k,double 1):Point(i,j)
{
w=k;h=l;
}
void fun(Point&s)
{
cout<<s.Area( )<<endl;
}
void main( )
{
Rectangle rec(3.0,5.2,15.0,25.0);
fun(rec);
}
本题关键词:行为结果,行为结果评价,道德行为效果,竣工结算程序,执业资格行为,行政诉讼程序,结果,工程行为识别,行为过程评价,序列关系;