在Visual FoxPro中,有如下程序: *程序名:TEST.PRG SET TALK OFF PRIVATE X,Y X=”计算机” Y=”等级考试” D0 subl ?X+Y RETURN *子程序:sub1 PROCEDU sub1 LOCAL X X=”考试” Y=”系统” X=X+Y RETURN执行命令DO TEST后,屏幕显示的结果应是( )。
A. 考试系统
B. 计算机系统
C. 等级考试系统
D. 计算机等级考试
第1题:
在 Visual FoxPro 中,有如下程序:
* 程序名: TEST.PRG
SET TALK OFF
PRIVATE X,Y
X= " 数据库 "
Y= " 管理系统 "
DO subl
? X+Y
RETURN
* 子程序: subl
PROCEDU subl
LOCAL X
X= " 应用 "
Y= " 系统 "
X=X+Y
RETURN
执行命令 DO TEST 后,屏幕显示的结果应是 【 13 】 。
第2题:
有以下程序: #include <iostream> #include <string> using namespace std; class Y; class X { private: int x; char *strx; public: X(int a, char *str) { x=a; strx=new char[strlen(str)+1]; strcpy(strx,str); } void show(Y &ob) ; }; class Y { private: int y; char *stry; public: Y(int b,char *str) { y=b; stry=new char[strlen(str)+1]; strcpy(stry, str); } friend void X: :show(Y &ob) ; }; void X: :show(Y &ob) { cout<<strx<<", "; cout<<ob, stry<<end1; } int main ( ) { X a(10,"X"); Y b (20, "Y"); a. show(B) ; return 0; } 执行后的输出结果是( )。
A.X,Y
B.a,b
C.X,X
D.Y,Y
第3题:
有以下程序: #include <iostream> #include <math> using namespace std; class point { private: double x; double y; public: point(double a,double b) { x=a; y=b; } friend double distance(point a,point b) ; }; double distance(point a,point b) { return sqrt ((a.x-b.x)* (a.x-b.x)+(a.y-b.y)*(a.y-b.y)); } int main ( ) { point pl(1,2); point p2 (5, 2); cout<<distance (pl,p2) <<end1; return 0; } 程序运行后的输出结果是( )。
A.1
B.5
C.4
D.6
第4题:
有以下程序: #include<iostrearn> using namespace std; class sample { private: int x; static int y; public: sample (int A) ; static void print (sample s); }; sample::sample(int A) { x=a; y+=x; }
A.x=10,y=20
B.x=20,y=30
C.x=30,y=20
D.x=30,y=30
第5题:
有以下程序:#include <iostream>using namespace std;class sample{private: int x; static int y;public: sample(int a); static void print(sample s);};sample:: sample(int a){ x=a; y+=x;}void sample:: print(sample s){ cout<<"x="<<s. x<<",y="<<y<<end1;}int sample:: y=0;int main(){ sample s1(10); sample s2(20); sample:: print(s2); return 0;}程序运行后的输出结果是( )。
A.x=10,y=20
B.x=20,y=30
C.x=30,y=20
D.x=30,y=30
第6题:
在Visual FoxPr0中,有如下程序: *程序名:TEST.PRGSET TALK OFF PRIVATE X,YX=”数据库”Y=”管理系统”DO sub 1 7 X+YRETURN*子程序:subl PROCEDU sublLOCAL X X=”应用”Y=”系统”X=X+YRETURN 执行命令DO TEST后,屏幕显示的结果应是( )。
A. 数据库系统
B. 应用系统
C. 数据库管理系统
D. 应用管理系统
第7题:
有以下程序: #include <iostream> using namespace std; class A { private: int x,y; public: void set (int i,int j) { x=i; y=j; } int get_y() { return y; } }; class box { private: int length,width; A label; public: void set(int 1,int w, int s,int p) { length=1; width=w; label.set(s,p); } int get_area() { return length*width; } }; int main() { box small; small.set(2,4,1,35); cout<<small.get_area()<<end1; return 0; } 运行后的输出结果是( )。
A.8
B.4
C.35
D.70
第8题:
有如下程序: #include<iostream> using namespace std; Class TestClass { private: int x,y; public: TestClass(int i,int j) { x=i; y=j; } void print() { cout<<“print1”<<endl; } void print()const { cout<<”prin
A.printl
B.print2
C.printl print2
D.程序编译时出错。
第9题:
在Visual FoxPro中,有如下程序: *程序名:TEST.PRG *调用方法:DO TEST SET TALK OFF PRIVATE X,Y X="Visual FoxPro" Y="二级" DO SUB WITH X ?Y+X RETURN *子程序:SUB PROCEDURE SUB PARAMETER
A.二级Visual FoxPro
B.计算机等级二级Visual FoxPro考试
C.二级Visual FoxPro考试
D.计算机等级二级Visual FoxPro