标准模块中有如下程序代码: Public x As Integer,y As Integer Sub var pub( ) x=10:y=20 End Sub 在窗体上有1个命令按钮,并有如事件过程: Private Sub Command1 Click( ) Dim x As Integer Call var pub x=x+100 y=y+100 Print x;y End Sub 运行程序后单击命令按钮,窗体上显示的是( )。A.100 100B.100 120C.110 100D.110 120

题目

标准模块中有如下程序代码: Public x As Integer,y As Integer Sub var pub( ) x=10:y=20 End Sub 在窗体上有1个命令按钮,并有如事件过程: Private Sub Command1 Click( ) Dim x As Integer Call var pub x=x+100 y=y+100 Print x;y End Sub 运行程序后单击命令按钮,窗体上显示的是( )。

A.100 100

B.100 120

C.110 100

D.110 120


相似考题
更多“标准模块中有如下程序代码: Public x As Integer,y As Integer Sub var pub( ) x=10:y=20 End S ”相关问题
  • 第1题:

    以下程序的执行结果是【 】。 include class Sample { public: int x: int y; void di

    以下程序的执行结果是【 】。

    include<iostream. h>

    class Sample

    {

    public:

    int x:

    int y;

    void disp()

    {

    cout<<"x="<<x<<",y="<<y<<end1;

    }

    };

    void main()

    {

    int Sample:: ** pc;

    Sample s;

    pc=& Sample: :x;

    s.*pc=10;

    pc:=&Sample: :y;

    s.*pc=20;

    s.disp();

    }


    正确答案:x=10y=20
    x=10,y=20 解析:本题比较特殊,考察域作用符的使用规则。其实际含义是;指针先指向x,然后指向y,并利用该指针分别为x和y赋值。在使用过程中进行了作用域的限定。

  • 第2题:

    有以下程序: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=20

    B.x=20,y=30

    C.x=30,y=20

    D.x=30,y=30


    正确答案:B

  • 第3题:

    11、下面哪些定义是类型正确的?

    A.f :: (Integer, Integer) -> Float f (x,y) = x / y

    B.f :: (Integer, Integer) -> Float f (x,y) = (fromInteger x) / (fromInteger y)

    C.f :: (Integer, Integer) -> Float f (x,y) = 3*x + y

    D.f :: (Integer, Integer) -> Integer f (x, y) = 3*x + y


    AFT 通常由含有一个双氢呋喃环和一个氧杂萘邻酮(香豆素)的基本架构单位构成 AFT 分为 黄曲霉毒素B1(AFB1)、黄曲霉毒素 B2 (AFB2) 黄曲霉毒素G1(AFG1)、黄曲霉毒素 G2(AFG2) 黄曲霉毒素M1(AFM1)、黄曲霉毒素 M2(AFM2) B1、G1的呋喃环氢键异构。M1型氢键变为羟基。 1比2呋喃环上多了一个双键。

  • 第4题:

    以下程序的执行后,x和y的值是 ______ 。 include class Sample { public: int x;

    以下程序的执行后,x和y的值是 ______ 。 #include <iostream. h> class Sample { public: int x; int y; void disp() { cout<<"x="<<x<<", y="<<y<<end1; } }; void main() int Sample: :*pc; Sample s; pc=&Sample:: x; s. *pc=10; pc=&Sample: :y; s. *pc=.20; s. disp ();

    A.x=10, y=20

    B.x=20, y=10

    C.x=10, y=10

    D.x=20, y=20


    正确答案:A

  • 第5题:

    有以下程序:includeincludeusingnamespacestd;classDistance;classpoint{pub

    有以下程序: #include <iostream> #include <cmath> using namespace std; class Distance; class point { public: friend class Distance; Point(int a,int B) { x=a; Y=b; } void Print() { cout<<"X= "<<X<<end1; cout<<"Y= "<<Y<<end1; } private: float X,Y; }; class Distance { public: float Dis(Point &p,Point &q); }; float Distance :: Dis(Point &p,Point &q) { float result; result=sqrt((p.X-q.X)*(p.X-q.X)+(p.Y-q.Y)*(p.Y-q.Y)); cout<<result<<end1; retUrn result; } int main() { Point p(10,10),q(10,30); Distance d; d.Dis(p,q); return 0; } 运行后的输出结果是( )。

    A.10

    B.30

    C.0

    D.20


    正确答案:D
    解析:本题程序通过把类Distance定义为类Point类的友元类来实现计算两点之间距离的功能。主函数中定义两个对象点p,q,然后调用对象d的成员函数Dis()计算两点之间的距离。