A.从事各类房屋建筑,建设单位在开工前应当向工程所在地的县级以上人民政府建设行政主管部门申请领取施工许可证
B.从事各类房屋建筑,建设单位在开工前应当向工程所在地的县级以上人民政府规划行政主管部门申请领取施工许可证
C.按照国务院规定的权限和程序批准开工报告的建筑工程,不再领取施工许可证
D.按照国务院规定的权限和程序批准开工报告的建筑工程,必须领取施工许可证
E.工程投资额在300万元以下或者建筑面积在3000㎡以下的建筑工程,可以不申请办理施工许可证
第1题
使用VC6打开考生文件夹下的工程proj2。此工程包含一个源程序文件main2.cpp,但该程序运行有问题。请改正main函数中的错误。
源程序文件main2.cpp清单如下:
//main2.cpp
include <iostream>
using namespace std;
class MyClass
{
public:
MyClass(int m)
{
member=m;
}
~MyClass() {}
int GetMember()
{
return member;
}
private:
int member;
};
MyClass MakeObject(int m)
{
MyClass *pMyClass=new MyClass(m);
return *pMyClass;
}
int main ()
{
int x=7;
/************found**************/
MyClass *myObj=MakeObject(x);
/*************found*************/
cout<<"My object has member"<<myObj.GetMember()<<end1;
return 0;
}
第2题
使用VC6打开考生文件夹下的工程test29_1,此工程包含一个源程序文件test29_1.cpp,但该程序运行有问题,请改正程序中的错误,使该程序的输出结果为:
A:no parameters
B:int parameter
A:no parameters
B:int parameter
C:int parameter
源程序文件test29_1.cpp清单如下;
include <iostream.h>
class A
{
/***************** found *****************/
private:
A(){ cout<<"A:no parameters\n";}
A(int a) {cout<<"A: int parameter\n";}
};
class B:public A
{
public:
B(int a){cout<<"B:int Parameter\n";}
};
/***************** found *****************/
class C:public B,public A
{
public:
/***************** found *****************/
C(int a) ::B(a) {cout<<"C: int parameter\n"; )
};
void main ()
{
B b(1);
C c(2);
}
第3题
使用VC6打开考生文件夹下的工程test18_1,此工程包含一个源程序文件(est18_1.cpp,但该程序运行有问题,请改正程序中的错误,使程序的输出结果如下:
Enter x and y:
-4 -5
xoffset=1
yoffset=1
angle=45
radius=1.41421
源程序文件test18_1.cpp 清单如下:
include <iostream.h>
include <math.h>
class point
{
public:
void set(double ix,double iy)
{
x=ix;
y=iy;
}
double xoffset()
{
return x;
}
double yoffset()
{
return y;
}
double angle ()
{
return (180/3.14159)*atan2(y,x);
}
/**************** found *******************/
inline radius ()
{
return sqrt(x*x+y*y);
}
protected:
double x;
double y;
};
void main()
{
point p;
double x,y;
cout<<"Enter x and y:\n";
cin>>x>>y;
p.set(x,y);
/**************** found *******************/
p.x+=5;
p.y+=6;
/**************** found *******************/
cout<<"xoffset="<<p.xoffset()<<end1;
cout<<"yoffset="<<p.yoffset()<<end1;
cout<<"angle="<<p.angle()<<end1;
cout<<"radius="<<p.radius()<<end1;
第4题
使用VC6打开考生文件夹下的工程test22_1,此工程包含—个源程序文件test22_1.cpp,但该程序运行有问题,请改正程序中的错误,使程序的输出结果为:
6/15
3/4
9/19
源程序文件test22_1.cpp清单如下:
include<iostream.h>
class Franction
{
int nume;
int deno;
public:
Franction FranAdd(const Franction& x)
{
this->nume+=x.nume;
this->deno+=x.deno;
/****************found*******************/
return this;
}
void InitFranction() {nume=0; deno=l;}
void InitFranction(int n, int d) {nume=n; deno=d;}
void FranOutput() {cout<<nume<<'/'<<deno<<endl;}
};
void main()
{
Franction *a=new Franction;
Franction *b=new Franction;
a->InitFranction(6,15);
b->InitFranction(3,4);
a->FranOutput();
b->FranOutput();
Franction c;
/****************found*******************/
c->InitFranction();
/****************found*******************/
c=a->FranAdd(b);
c. FranOutput();
}
第5题
The grade is 3
源程序文件test21_1.cpp清单如下:
include<iostream.h>
class student
{
private:
int grade;
public:
/**************** found*******************/
student(int thegra):(thegra){}
~student(){}
int get_grade(){return grade;}
};
void main()
{
int thegra=3;
/**************** found*******************/
student point=new student(thegra);
/**************** found*******************/
cout<<"The grade is"<<point.get_grade()<<endl;
delete point;
}
第6题
源程序文件RevMain3.cpp清单如下:
//RevMain3.cpp
include<iostream>
using namespace std;
class MyClass{
public:
/* * * * * * * * *found * * * * * * + * * */
void MyClass(int a){ value=a;}
int Max(int x,int y)
{
if(x>y)
return x>y?x:y;
else
return y>value?y:value;
}
/* * * * * * * * *found * * * * * * * * * */
~MyClass(int a)
{
value=a;
}
private:
int value;
};
int main()
{
MyClass my(10);
cout<<my.Max(20,30)<<end1;
return 0;
}
第7题
x=20
源程序文件RevMain4.cpp的清单如下:
//RevMain4.cpp
include<iostream>
using namespace std;
class MyClass
{
public:
MyClass(int a)
{
x=a;
}
void setX(int a)
{
x=a;
}
void print()
{
cout<<"x="<<x;
}
private:
int x;
};
int main()
{
const MyClass obj (10);
/ ************found**************/
obj.setX(20);
/ ************found**************/
obj.print();
return 0;
}
第8题
100
源程序文件test27_1.cpp清单如下:
include <iostream.h>
template <class T>
class pair
{
T valuel, value2;
public:
pair (T first, T second)
{valuel=first; value2=second;}
/***************** found *****************/
char getmax ();
};
/***************** found *****************/
T pair<T>::getmax ()
{
T retval;
/***************** found *****************/
retval = valuel>value2?? value1 : value2;
return retval;
}
void main ()
{
pair <int> myobject (100, 75);
cout << myobject.getmax()<<end1;
}
第9题
A:a=5
display1:a=6
display2:a=5
源程序文件test3_1.cpp清单如下:
include<iostream.h>
Class A
{
public:
/**********found**********/
A (){}
void printa(){cout<<"A:a="<<a<<endl;}
private:
int a;
/***********found**********/
class B;
};
class B
{
public:
/*********found**********/
void display1(A t)
{
(*t).a++;cout<<"display1:a="<<(*t).a<<endl;
}
void display2(A t)
{
t.a--;cout<<"display2:a="<<t.a<<end1;
}
};
void main()
{
A obj1;
B obj2;
obj1.printa();
obj2.display1(&obj1);
obj2.display2(obi1);
}
第10题
David 3123 1000
源程序文件test34_1.cpp清单如下:
include <iostream.h>
include <string.h>
class person
{
public:
char name[20];
unsigned long id;
float salary;
void print(){cout<<name<<' '<<id<<' '<<salary<<
/***************** found *****************/
}
void main()
{
person p;
person *ptr;
/***************** found *****************/
ptr=p;
/***************** found *****************/
strcpy("David",ptr->name);
ptr->id=3123;
ptr->salary=1000;
ptr->print();
}
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!