A.根据土石方调配要求,采用适当的钻爆、运输机具施工
B.既有线旁或边坡较高时,应分级开挖
C.路堑较长时,可适当开设马口
D.纵向台阶开挖不适用于土、石质傍山路堑
E.边坡高度大于20m的软弱、松散岩质路堑,宜采取分级开挖、分级支挡、分级防护和坡脚预加固措施
第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题
源程序文件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;
}
第3题
第4题
请使用VC6或使用【答题】菜单打开考生文件夹projl下的工程projl,该工程含有一个源程序文件pn,jl.cpp。其中位于每个注释“//ERROR 木}}水found}}水木”之后的一行语句存在错误。请改正这些错误,使程序的输出结果为: The value is 10 注意:只修改注释“//ERROR **** found****”的下一行语句,不要改动程序中的其他内容。 //pmjl.cpp include using namespace std; class MyClass{ int value; public: //ERROR********found********* void MyClass(int val):value(val){} int GetValueconst{return value;} void SetValue(int val); }; //ERROR********found******** inline void SetValue(int val){value=val;} int main MyClass obj(O); obj.SetValue(10); //ERROR********found********下列语句功能是输出obj的成员value的值 tout$amp;
第5题
使用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);
}
第6题
使用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;
第7题
5
5
源程序文件test28_1.cpp清单如下:
include <iostream.h>
class A{
public:
/***************** found *****************
static int n=1;
A(){n++;};
~A() (n--;};
};
/***************** found *****************
int n=0;
int main() {
A a;
A b[3];
A *c=new A;
c=&a;
/***************** found *****************
cout<<c.n<<end1;
cout<<A::n<<end1;
return 0;
}
第8题
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;
}
第9题
使用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();
}
第10题
80
150
100
1
注意:只能在横线处填写适当的代码,不要改动程序中的其他内容,也不要删除或移动“//****found****”。
include<iostream.h>
class vehicle
{
private:
int MaxSpeed;
int Weight;
public:
//*************found************
vehicle(int maxspeed,int weight):——
~vehicle{};
int getMaxSpeed{return MaxSpeed;}
int getWeight{retum Weight;}
};
//****************found************
class bicycle:——public vehicle
{
private:
int Height;
public:
bicycle(int maxspeed,int weight,int height):vehicle(maxspeed,weight),Height(height){}
int getHeight{retum Height;};
};
//*******************found**************
class motorcar:——public vehicle
{
private:
int SeatNum;
public:
motorcar(int maxspeed。int weight,int seatnum):vehicle(maxspeed,weight),SeatNum(seatnum){}
int getSeatNum{return SeatNum;};
};
//*****************found***************
class motorcycle:——
{
public:
motorcycle(int maxspeed,int weight,int height):vehicle(maxspeed,weight),bicycle(maxspeed,weight,
height),motorcar(maxspeed,weight,1){}
};
void main
{
motorcycle a(80,150,100);
cout<<a.getMaxSpeed<<endl;
cout<<a.getWeight<<endl;
cout<<a.getHeight<<endl;
cout<<a.getSeatNum<<endl;
}
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!