网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

有如下程序:

Private type stu

X as string

Y as integer

End type

Private Sub Command1_Click()

Dim a as stu

a.x=”ABCD”

a.Y=12345

print a

End Sub

程序运行时出现错误,错误的原因是

A)Type定义语句没有放在标准模块中

B)变量声明语句有错

C)赋值语句不对

D)输出语句print不对


参考答案

更多 “ 有如下程序:Private type stuX as stringY as integerEnd typePrivate Sub Command1_Click()Dim a as stua.x=”ABCD”a.Y=12345print aEnd Sub程序运行时出现错误,错误的原因是A)Type定义语句没有放在标准模块中B)变量声明语句有错C)赋值语句不对D)输出语句print不对 ” 相关考题
考题 有如下程序: include using namespace std; class Monitor{ public: Monitor(cha 有如下程序:include<iostream>using namespace std;class Monitor{public:Monitor(char t):type(t){ }void Print( )const{cout<<"The type of monitor is"<<type private:char type;};class Computer{public:Computer(int i,char C) :______{}void Print( )const{eout<<"The computer is"<<id<<endl;mort.Print( );}private:int id;Monitor mon;};int main( ){const Computer myComputer(101,'B');myComputer.Print( );return 0;}请将程序补充完整,使程序在运行时输出:The computer is 101The type of monitor is B

考题 有如下程序:includeusing namespace std;Class TestClass{private:int x,y;public:Te 有如下程序: #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<<”prinA.printlB.print2C.printl print2D.程序编译时出错。

考题 有如下程序:includeusing namespace std;class Base{private:char c;piblic:Base(cha 有如下程序: #include<iostream> using namespace std; class Base { private: char c; piblic: Base(char n):c(n){} ~Base() { cout<<C; } }; class DeriVed:public Base { private: char c; public: Derived(char n):Base(n+1),c(n){} ~Derived() { cout<<c; } }; int main() { Derived obj('x'); return 0; } 执行上面的程序将输出A.xyB.yxC.xD.y

考题 有以下程序:include using namespace std;class sample{private: int x; static int 有以下程序:#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=20B.x=20,y=30C.x=30,y=20D.x=30,y=30

考题 有以下程序:includeusing namespace std;class sample{private:int x;static int y; 有以下程序: #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=20B.x=20,y=30C.x=30,y=20D.x=30,y=30

考题 有如下程序:include using namespace std;class Base{private:charc;public:Base(cha 有如下程序:#include <iostream>using namespace std;class Base{private: char c;public: Base(char n) :c(n){} ~Base() { cout<<c; } };class Derived: public Base{private: char c; public: Derived(char n):Base(n+1),c(n) {} ~Derived() { cout<<c; }};int main (){ Derived obj ('x'); return 0;}执行上面的程序净输出A.xyB.yxC.xD.y

考题 有以下程序:include include using namespace std;class Y;class X{private 有以下程序: #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,YB.a,bC.X,XD.Y,Y

考题 有下列程序:includeusing namespace std;class TestClass{private:int x,y;public:Te 有下列程序: #include<iostream> using namespace std; class TestClass { private: int x,y; public: TestClass (int i,int j) { x=i; y=j; } void print() { cout<<"printl"<<endl; } voA.print1B.print2C.pfint1 print2D.程序编译时出错

考题 有以下程序:include using namespace std;define PI 3.14class Point{ private:int 有以下程序: #include <iostream> using namespace std; #define PI 3.14 class Point { private: int x,y; public: Point(int a,int b) { x=a; y=b; } int getx() { return x; }A.314B.157C.78.5D.153.86

考题 有如下程序:include using namespace std;class Base{private:char c;public:Base(ch 有如下程序:#include <iostream>using namespace std;class Base{private: char c;public: Base(char n):c(n){} ~Base() { cout<<c; }};class Derived: public Base{private: char c;public: Derived(char n):Base(n+1),c(n){} ~Derived() { cout<<c; }};int main(){ Derived obj('x'); return 0; }执行上面的程序将输出( )。A.xyB.yxC.xD.y