当发生Form_Click事件时,下列程序的输出结果是( )。 Private m As Integer,n As Integer Private Sub Form_Click() Dim k As Integer,p As Integer k=6:p=60 Call sub1(k,p) Print m,n,m,k,p Call sub1(k,p) Print m,n,k,p End Sub Private Sub Form_Load() m=7 n=70 End Sub Public Sub sub1(

题目

当发生Form_Click事件时,下列程序的输出结果是( )。 Private m As Integer,n As Integer Private Sub Form_Click() Dim k As Integer,p As Integer k=6:p=60 Call sub1(k,p) Print m,n,m,k,p Call sub1(k,p) Print m,n,k,p End Sub Private Sub Form_Load() m=7 n=70 End Sub Public Sub sub1(x As Integer,ByVal y As Integer) Dim m As Integer n=n+5 m=n+x+y x=x+y y=x+y End Sub

A.7 75 66 60 7 80 126 60

B.7 75 66 60 7 75 126 60

C.7 75 66 60 7 80 66 60

D.7 75 66 60 7 75 66 60


相似考题
更多“当发生Form_Click事件时,下列程序的输出结果是()。Private m As Integer,n As IntegerPrivate Sub ”相关问题
  • 第1题:

    当Form_Click事件发生时,程序输出的结果是 ______。 Private Sub Form. Click() Dim a As Integer,b As Integer,c As Integer a=1: b=1 Print a; b Do c=a+b Print c a=b:b=c Loop Until c>=5 End Sub

    A.1 1 1

    B.2 3 5

    C.2 5 7

    D.2 3 4


    正确答案:B
    解析:当发生窗体单击事件时,首先给变量a和b赋值1,然后输出为11,并换行,执行循环,c值为2,输出2后不换行,进行赋值后a为1,b为2,判断“c>=5”为False,继续执行下一循环。第二次循环输出c值为3,循环终止条件仍为False。第三次执行后,c值为5,循环终止条件为True,循环退出。因此输出的第二行为“235”。

  • 第2题:

    若有以下程序: include usingnamespace std; class Sample { private: const int n;

    若有以下程序:

    include <iostream>

    using namespace std;

    class Sample

    {

    private:

    const int n;

    public:

    Sample(int i) :n(i) {)

    void print()

    {

    cout<<"n="<<n<<end1;

    }

    };

    int main()

    {

    sample a(10);

    a.print();

    return 0;

    }

    上述程序运行后的输出结果是【 】。


    正确答案:n=10
    n=10 解析:本题考核常成员数据的应用。类Sample中,定义了一个常数据成员n,所以构造函数只能通过初始化列表来初始化它。

  • 第3题:

    有以下程序:include using namespace std;class sample{private:int n;public:sample

    有以下程序: #include <iostream> using namespace std; class sample { private: int n; public: sample(){} sample(int m) { n=m; } void addvalue(int m) { sample s; s.n=n+m; *this=s; } void disp () { cout<<"n="<<n<<endl; } }; int main() { sample s (10); s.addvalue(5); s.disp(); return 0; } 程序运行后的输出结果是

    A.n=10

    B.n=5

    C.n=15

    D.n=20


    正确答案:C
    解析:本题考核this指针的应用。上述程序中sample类定义了一个addvalue非静态成员函数。addvalue函数的原型是:void addvalue(sample *this,int m);,该函数的第一个参数是执行该类对象的一个指针即this指针。由于这个参数是系统隐含的,所以我们在定义该成员函数时并没有看到这样一个参数。在成员函数的定义体中,可以通过this访问这一参数。上述程序的最后输出结果是15。

  • 第4题:

    若有以下程序:includeusing namespace std;class sample{private:int n;public:sampl

    若有以下程序: #include<iostream> using namespace std; class sample { private: int n; public: sample(){} sample(int m) { n=m; } void addvalue(int m) { sample s; s.n=n+m; *this=s; } void disp() { cout<<"n"=<<n<<end1; } }; int main() { sample s(10); s.addvalue(5); s.disp(); return 0; } 程序运行后的输出结果是

    A.n=10

    B.n=5

    C.n=15

    D.n=20


    正确答案:C
    解析:本题考核this指针的应用。上述程序中sample类定义了一个addvalue非静态成员函数。addvalue函数的原型是:voidaddvalue(sample*this,intm);,该函数的第一个参数是执行该类对象的一个指针即this指针。由于这个参数是系统隐含的,所以我们在定义该成员函数时并没有看到这样一个参数。在成员函数的定义体中,可以通过this访问这—参数。上述程序的最后输出结果是15。

  • 第5题:

    有以下程序:include using namespace std;class sample {private: iht n;public: sam

    有以下程序: #include <iostream> using namespace std; class sample { private: iht n; public: sample(){} sample(int m) { n=m; } void addvalue(int m) { sample s; s.n=n+m; *this=s; } void disp() { cout<<"n="<<n<<end1; } }; int main() { sample s(10); s.addvalue(5); s.disp(); return 0; } 程序运行后的输出结果是

    A.n=10

    B.n=5

    C.n=15

    D.n=20


    正确答案:C
    解析:本题考核this指针的应用。上述程序中sample类定义了一个addvalue非静态成员函数。addvalue函数的原型是:voidaddvalue(sample*this,intm);,该函数的第一个参数是执行该类对象的一个指针即this指针。由于这个参数是系统隐含的,所以我们在定义该成员函数时并没有看到这样一个参数。在成员函数的定义体中,可以通过this访问这一参数。上述程序的最后输出结果是15。