1、有界缓冲问题中,“counter++”的伪机器语言为: (S0)register1 = counter (S1)register1 = register1 + 1 (S2)counter = register1 “counter—”的伪机器语言为: (S3)register2 = counter (S4)register2 = register2 – 1 (S5)counter = register2 当这两段代码并行执行时,有()种不同的执行结果。A.1B.2C.3D.4

题目

1、有界缓冲问题中,“counter++”的伪机器语言为: (S0)register1 = counter (S1)register1 = register1 + 1 (S2)counter = register1 “counter—”的伪机器语言为: (S3)register2 = counter (S4)register2 = register2 – 1 (S5)counter = register2 当这两段代码并行执行时,有()种不同的执行结果。

A.1

B.2

C.3

D.4


相似考题
参考答案和解析
C
更多“1、有界缓冲问题中,“counter++”的伪机器语言为: (S0)register1 = counter (S1)register1 = register1 + 1 (S2)counter = register1 “counter—”的伪机器语言为: (S3)register2 = counter (S4)register2 = register2 – 1 (S5)counter = register2 当这两段代码并行执行时,有()种不同的执行结果。”相关问题
  • 第1题:

    在窗体上画一个命令按钮和一个标签,其名称分别为Command1和Labell,然后编写如下事件过程: Private Sub Command1_Click() Counter=0 For i=1 To 4 For j=6 To 1 Step -2 Counter=Counter+1 Next j Next i Labell.Captidn=Str(Counter) End Sub 程序运行后,单击命令按钮,标签中显示的内容是______。

    A.11

    B.12

    C.16

    D.20


    正确答案:B
    解析:在For循环中,Step是用于指定计数器的步长,本题中是-2,就是每执行一次循环后,j的值减2。程序共有两层循环,当外层循环执行第一次时,j从6开始执行循环,当j=0时,结束循环,此时Counter=1+1+1=3。而外循环一共要执行4次,所以Counter=3+3+3+3=120

  • 第2题:

    听力原文:M: Would you please tell me where I can change the RMB Yuan back into US dollars?

    W: OK, just go to the Counter No. 16. They will do this for you.

    Q: Which counter can offer the service of reconversion for the customer?

    (19)

    A.Counter No.12.

    B.Counter No.6.

    C.Counter No.15.

    D.Counter No.16.


    正确答案:D
    解析:男士是想将人民币兑换美元,女士则告之去"Counter No.16"。

  • 第3题:

    Whatwillbetheresultofattemptingtocompileandrunthefollowingprogram?()publicclassQ28fd{publicstaticvoidmain(Stringargs[]){intcounter=0;l1:for(inti=10;i<0;i--){l2:intj=0;while(j<10){if(j>i)breakl2;if(i==j){counter++;continuel1;}}counter--;}System.out.println(counter);}}

    A.Theprogramwillfailtocompile.

    B.Theprogramwillnotterminatenormally.

    C.Theprogramwillwrite10tothestandardoutput.

    D.Theprogramwillwrite0tothestandardoutput.

    E.Theprogramwillwrite9tothestandardoutput.


    参考答案:A

  • 第4题:

    在窗体上画一个命令按钮和一个标签,其名称分别为Commandl和Labell,然后编写如下事件过程:

    Private Sub Command1_Click()

    Counter=0

    Fori=1 T04

    Forj=6 To 1 Step一2

    Counter=Counter+1

    Next j

    Nexti

    Labell.Caption=Str(Counter)

    End Sub

    程序运行后,单击命令按钮,标签中显示的内容是

    A.11

    B.12

    C.16

    D.20


    正确答案:B
    解析:该题考核点在于嵌套循环,运算过程中各变量的取值如下:

  • 第5题:

    有如下的程序段,该程序段执行完后,共执行的循环次数是 total=0 Counter=1 Do Print Counter total=total * Counter + 1 Print total Counter=Counter +1 If total > 10 Then Exit Do End If Loop While Counter<=10

    A.4

    B.10

    C.15

    D.20


    正确答案:A
    解析:Do…LoopWhile语句本题中Counter为计数器,当Counter=4时,total=41>10,跳出循环,共执行4次循环。注意:Do…LoopWhile结构和条件语句或多分支结构的嵌套结构。

  • 第6题:

    有如下的程序段,该程序段的执行完后,共执行循环的次数是 Private Sub Command1_Click() total=0 Counter=l Do Print Counter total=total+Counter Print total Counter=Counter+1 If total>=10 Then Exit Do End If Loop While Counter<=10 End Sub

    A.5

    B.10

    C.12

    D.20


    正确答案:A
    解析:本题考查Do循环内的嵌套语句。由于本题在Do循环内嵌套If语句,当If语句满足条件时,Do循环也可以终止,故要比较Total>=10与Counter>10这两个条件谁先达到。通过观察去执行第五次循环时,Total值满足条件, Do循环终止,故选择A。

  • 第7题:

    有如下程序: Private Sub Form_C1ick() Dim CheCk,Counter CheCk=True Counter=0 Do Do While Counter<20 Counter=Counter+1 If Counter=10 Then Check=False Exit Do End If Loop Loop Until Check=False Ptint Counter,Check End Sub 程序运行后,单击窗体,输出结果为______。

    A. 15 0

    B.20 -1

    C.10 Tree

    D.10 False


    正确答案:D
    解析:Do While…Loop是先判断条件表达式的值是否为True,如果为True,则执行循环体,如果为False,则执行Loop后面的语句。Do…Loop Until是先执行循环体,再判断条件表达式,如果表达式的值为True,则执行Loop后面的语句,如果为False,则继续执行循环体。而Exit Do则是强行退出循环。当Counter =10时,强行退出DoWhile循环,而由于此时Check=False,使得umil的条件为True,结束外层循环。所以最终Coumer=10。

  • 第8题:

    【问题3】(2分)

    从上述ASP代码可以判断出,计数器表counter中statdtm的字段类型是 (14) ,counter的字段类型是(15) 。


    正确答案:
    【问题3】(2分)
    (14)日期型 
    (15)数值型

  • 第9题:

    AD166出现“维修呼叫M1”,如何清除()

    • A、在维修模式-“COUNTER”-“SUPPLIES LIFE COUNTER”中清除计数器
    • B、在维修模式-“CLEARDATA”-“SUPPLIES LIFE COUNTER”中清除
    • C、计数器在维修模式-“COUNTER”-“MAINTENCE COUNTER”中清除
    • D、在维修模式-“SERVICES’CHOICE”-“MAINTENCE COUNTER”中将数

    正确答案:D

  • 第10题:

    What will be the result of attempting to compile and run the following program?()   public class Q28fd {   public static void main(String args[]) {   int counter = 0;   l1:   for (int i=10; i<0; i--) {   l2:  int j = 0;   while (j < 10) {   if (j > i) break l2;   if (i == j) {   counter++;   continue l1;   }   }   counter--;   }   System.out.println(counter);  }   }   

    • A、The program will fail to compile.
    • B、The program will not terminate normally.
    • C、The program will write 10 to the standard output.
    • D、The program will write 0 to the standard output.
    • E、The program will write 9 to the standard output.

    正确答案:A

  • 第11题:

    多选题
    中行移动柜台和Pad端镜像说法正确的有:()
    A

    中行移动柜台和Pad端镜像不同

    B

    移动柜台柜机端系统镜像和Pad镜像都有Counter的目录

    C

    移动柜台柜机端系统镜像有Counter的目录

    D

    Pad镜像都有Counter的目录


    正确答案: D,C
    解析: 暂无解析

  • 第12题:

    单选题
    SDCCH切换算法从哪个测量报告开始计算()
    A

    SDCCH_COUNTER+1

    B

    SDCCH_COUNTER+7

    C

    SDCCH_COUNTER+8

    D

    SDCCH_COUNTER+16


    正确答案: A
    解析: 暂无解析

  • 第13题:

    有如下程序:

    Private Sub Form_Click()

    Dim Check, Counter

    Check = True

    Counter = 0

    Do

    Do While Counter < 20

    Counter = Counter + 1

    If Counter = 10 Then

    Check = False

    Exit Do

    End If

    Loop

    Loop Until Check = False

    Print Counter, Check

    End Sub

    程序运行后,单击窗体,输出结果为( )。

    A.15 0

    B.20 -1

    C.10 True

    D.10 False


    正确答案:D

  • 第14题:

    有如下程序: Private Sub Form Click() Dim Check,Counter Check=True Counter=0 Do Do While Counter<20 Counter=Counter+1 If Counter=10 Then Check=False Exit Do End If Loop Loop Until Check=False Print Counter,Check End Sub 程序运行后,单击窗体,输出结果为

    A.15 0

    B.20 -1

    C.10 Tree

    D.10 False


    正确答案:D
    解析:本题考查嵌套的Do…Loop循环。Do循环嵌套的规则与For-Next循环相同,按照先进后出、后进先出的原则,不能交叉。考生需判断程序在何时跳出循环,内层循环是在Counter20时,对其加1,但要注意循环内的条件语句,当Counter=10时,跳出内层循环,同时将Check设为False。外层循环的循环条件是Check=False,所以当程序跳出内层循环时,外层循环的条件也满足了,故同时也跳出循环,此时Counter=10,Check为False,选项D正确。

  • 第15题:

    阅读下面的程序:

    PriVate Sub Form_C1ick()

    Dim Check As Booleau,Counter As Integer

    Check=True

    Counter=5

    Do

    Do While Counter<20

    Counter=Counter+1

    If Counter=10 Then

    Check=FalSe

    EXit Do


    正确答案:10
    10

  • 第16题:

    阅读下面的程序: Private Sub Form_Click() Dim Check, Counter Check=True Counter=0 Do Do While Counter < 20 Counter=Counter + 1 If Counter=10 Then Check = False Exit Do End If Loop Loop Until Check = False Print Counter, Check End Sub 程序运行后,单击窗体,输出的结果为

    A.15 0

    B.20 -1

    C.10 True

    D.10 False


    正确答案:D
    解析:这是一个二重循环,内层和外层都是Do循环。在内层循环中,执行循环体的条件是Counter20,由于Counter的初值为0,因此执行循环体。在循环体中,每次循环Counter加1,达到10后,将Check变量设置为False,同时执行ExitDo,退出内层循环。外层循环执行的条件是,变量Check的值是True,如果Check为False,则退出外层循环,输出结果,结束程序。由于在退出内层循环时,Check已被设置为False,因此退出内层循环后立即就可以退出外层循环。退出两层循环后,Counter和Check的值没有发生任何变化,与退出内层循环时相同,分别为10和False。

  • 第17题:

    有如下程序段,该程序段执行完后,执行循环的次数是 total=0 Counter=1 Do Print Counter total=total + Counter Print total Counter=Counter+1 If total>10 Then Exit Do End If Loop While Counter <=10

    A.5

    B.10

    C.15

    D.20


    正确答案:A
    解析:本题考查Do…LoopWhile语句,共执行了5次,total=1+2+3+4+5>10。

  • 第18题:

    给出下面的程序:Private Sub Command1_ Click() Dim Check, Counter Check= True: Counter = 0 do do while Counter < 20 Counter = Counter +1 if Counter = 10 then Check=False exit do End if Loop Loop until Check=False MsgBox CounterEnd Sub 程序最后弹出的消息对话框的内容是______。

    A.True

    B.False

    C.20

    D.10


    正确答案:D
    解析:本题的难点是dowhile…Loop和do…Loopuntil循环控制问题。实际上在该段程序中,有三处判断控制循环,条件先成立处先执行。首先变量“Counter=10”时,“Check=False”,退出内层循环,do…Loopuntil根据条件“Check=False”又退出外层循环,此时“Counter=10”。

  • 第19题:

    【问题2】(7分)

    该商务网站的计数器部分代码如下,请根据题目说明,将空缺的代码补充完整。

    <%

    set conn= server.createobject("adodb.connection")

    (7) .provider="sqloledb"

    provstr="serveF127.0.0.1;database= (8) L;uid=sa;pwd=9857452"

    conn_.open provstr

    set rs=conn.Execute("select*from counter")

    ……

    conn.Execute"Update counter set counteFcounter+l,today=o,statdtm=date(),daynum=

    daynum+l, yesterday=" &rs("today")&"”

    conn.Execute" (9) into yesday(yesday,stats) values(…&yesday&”’,”&rs(”today”)&”)”

    ……

    application. ( 10)

    if rs("top”)<rs("today") then

    conn.Execute"Update counter set counter=counter+1,today=today+1, [top]="&

    rs("today")&""

    else

    conn.Execute"Update counter set counter=counter+1,today=today+1"

    end if

    (11) .unlock

    end if

    counters= (12)

    today= (13)

    yesterday= rs("yesterday")

    rs.close

    setrs= nothing

    conn.close

    setconn=nothing

    %>

    document.write('<font style="FONT-SIZE: 12px;COLOR: #000000;">总共访问量:

    <%=counters%>,今日访问:<%=today%>,昨日访问:<%=yesterday%></font>');


    正确答案:
    【问题2】(7分)
    (7) conn 
    (8) business 
    (9) Insert 
    (10) fock 
    (11) application 
    (12) rs("counter") 
    (13) rs("today")

  • 第20题:

    有如下程序段,该程序段执行完后,共执行循环的次数是 Private Sub Command1_Click( ) Tota1=0 Counter=1 Do Print Counter Tota1=tota1+Counter Print total Counter=Counter+1 If total>=10 Then Exit Do End lf Loop While Counter<=10 End Sub

    A.5

    B.10

    C.12

    D.20


    正确答案:A
    解析:由于本题在Do循环内嵌套If语句,当If语句满足条件时,Do循环也可以终止,故要比较Total>=10与Counter>10这两个条件谁先达到。通过观察去执行第五次循环时,Total值满足条件,Do循环终止,故选择A。

  • 第21题:

    SDCCH切换算法从哪个测量报告开始计算()

    • A、SDCCH_COUNTER+1
    • B、SDCCH_COUNTER+7
    • C、SDCCH_COUNTER+8
    • D、SDCCH_COUNTER+16

    正确答案:A

  • 第22题:

    AD166系列机器要求设置A3计两张,需设置下列哪项()

    • A、Total Counter设置为1
    • B、Total Counter设置为2
    • C、Size Counter设置为1
    • D、Size Counter设置为2

    正确答案:B

  • 第23题:

    单选题
    What will be the result of attempting to compile and run the following program?()   public class Q28fd {   public static void main(String args[]) {   int counter = 0;   l1:   for (int i=10; i i) break l2;   if (i == j) {   counter++;   continue l1;   }   }   counter--;   }   System.out.println(counter);  }   }
    A

    The program will fail to compile.

    B

    The program will not terminate normally.

    C

    The program will write 10 to the standard output.

    D

    The program will write 0 to the standard output.

    E

    The program will write 9 to the standard output.


    正确答案: A
    解析: 暂无解析

  • 第24题:

    填空题
    下列程序的运行结果是()。  Program test      Implicit none      Integer,parameter:: limit=10      Integer counter      Integer:: ans=0      Counter=2     do while(counter<=limit)      ans=ans+counter      counter=counter+2   end do Wrte(*,*)ans end

    正确答案: 30
    解析: 暂无解析