参考答案和解析
正确答案:开启和关闭船舶货舱工作应由船上人员操作,费用由船东负责
更多“翻译:the opening and closing of ve”相关问题
  • 第1题:

    阅读以下说明和C++代码。

    【说明】

    传输门是传输系统中的重要装置。传输门具有Open(打开)、Closed(关闭)、Opening (正在打开)、StayOpen(保持打开)和Closing(正在关闭)五种状态。触发传输门状态转换的事件有click、complete和timeout三种。事件与其相应的状态转换如下图所示。

    下面的C++代码1与C++代码2分别用两种不同的设计思路对传输门进行状态模拟,请填补代码中的空缺。

    【C++代码1】

    const int CLOSED=1; const int PENING=2;

    const int PEN=3; const int CLOSING=4;

    const int STAYOPEN=5; //定义状态变量,用不同整数表示不同状态

    class Door {

    Private:

    int state; //传输门当前状态

    void setState(int state){ this->state=state;} //设置当前状态

    public:

    Door():state(CLOSED){};

    void getState(){ //根据当前状态输出相应的字符串

    switch(state){

    case OPENING: cout<<"OPENING"<<endl; break;

    case CLOSED: cout<<"CLOSED"<<endl; break;

    case OPEN: cout<<"OPEN"<<endl; break;

    case CLOSING: cout<<"CLOSING"<<endl; break;

    case STAYOPEN:cout<<"STAYOPEN"<<endl; break;

    }

    };

    void click() { //发生click事件时进行状态转换

    if ((1)) setState(OPENING);

    else if ((2)) setState(CLOSING);

    else if ((3)) setState(STAYOPEN);

    }

    void timeout(){ //发生timeout事件时进行状态转换

    if (state == OPEN) setState(CLOSING);

    }

    void complete(){ //发生complete事件时进行状态转换

    if (state == OPENING) setState(OPEN);

    else if (state == CLOSING) setState(CLOSED);

    }

    };

    int main(){

    Door aDoor;

    aDoor.getState();aDoor.click(); aDoor.getState();

    aDoor.complete();aDoor.getState(); aDoor.click();

    aDoor.getState();aDoor.click(); aDoor.getState(); return 0;

    }

    【C++代码2】

    class Door {

    public:

    DoorState *CLOSED,*OPENING,*OPEN,*CLOSING,*STAYOPEN,*state;

    Door();

    virtual~Door(){……//释放申请的内存,此处代码省略);

    void setState(DoorState *state) { this->state = state;}

    void getState(){

    //此处代码省略,本方法输出状态字符串,

    //例如,当前状态为CLOSED时,输出字符串为“CLOSED”

    };

    void click();

    void timeout();

    void complete();

    };

    Door::Door(){

    CLOSED = new DoorClosed(this); OPENING = new DoorOpening(this);

    PEN = new DoorOpen(this); CLOSING = new DoorClosing(this);

    STAYOPEN = new DoorStayOpen(this);state = CLOSED;

    }

    void Door :: click() {(4);)

    void Door :: timeout() {(5);)

    void Door :: complete() {(6);}

    class DoorState//定义一个抽象的状态,它是所有状态类的基类

    {

    protected:Door *door;

    public:

    DoorState(Door *door) {this->door = door;}

    virtual~DoorState(void);

    virtual void click() {}

    virtual void complete(


    正确答案:(1)state == CLOSED || state == CLOSING (2)state == OPENING || state == STAYOPEN (3)state == OPEN (4)state->click() (5)state->timeout() (6)state->complete() (7)door->setState(door->OPENING)
    (1)state == CLOSED || state == CLOSING (2)state == OPENING || state == STAYOPEN (3)state == OPEN (4)state->click() (5)state->timeout() (6)state->complete() (7)door->setState(door->OPENING) 解析:本题考查的是状态转换图的程序设计与实现。
    空(1)、(2)和(3)需要根据状态转换图来填写,空(1)、(2)和(3)所在的方法为click,表示当发生click事件时应该发生什么状态转换。根据代码可知,发生click事件时,状态分别跳转到OPENING,CLOSING和STAYOPEN,则发生click前的状态由状态转换图可以得到,分别为CLOSED或CLOSING、STAYOPEN或OPENING以及OPEN。
    代码2中空(4)、(5)和(6)考查当发生click、timeout以及complete事件的时候,状态应该如何迁移。类Door的state成员变量用于记录类Door所处的状态,而state变量的类型为DoorState *,DoorState中分别具有click、timeout和complete方法用来响应对应的事件,因此,空(4)、(5)和(6)分别为:state->click()、state->timeout()和 state->complete()。
    空(7)主要考查门的当前状态为CLOSED时,发生click事件时状态的迁移。根据状态图可知,CLOSED状态的在click事件下将迁移到OPENING,因此,此处应该将传输门状态设置为OPENING,DoorState变量存储了当前其存储的传输门的实例,因此,可直接调用其方法setState来设置状态,由于传输门状态采用类的实例变量表示,所以此处应该填写door->setState(door->OPENING)。
    代码1和代码2的区别是:代码2将状态间的转换规则封装到具体的类中,当状态转换图的转换规则发生变化时,只需更改部分对应类中的状态迁移规则,而代码1中的迁移规则散落在程序中,维护起来较为困难。

  • 第2题:

    请认真阅读以下关于某传输系统的技术说明、状态转换图及C++代码,根据要求回答问题1和问题2。

    【说明】

    传输门是传输系统中的重要装置。传输门具有Open(打开)、Closed(关闭)、Opening(正在打开)、StayOpen(保持打开)和Closing(正在关闭)5种状态。触发状态的转换事件有click、complete和timeout 3种,事件与其相应的状态转换如图6-18所示。

    下面的【C++代码1】与【C++代码2】分别用两种不同的设计思路对传输门进行状态模拟,请填补代码段中的空缺语句。

    【C++代码1】

    const int CLOSED = 1; const int PENING = 2;

    const int PEN = 3; const int CLOSING = 4;

    const int STAYOPEN = 5; //定义状态变量,用不同整数表示不同状态

    class Door {

    private:

    private:

    int state; //传输门当前状态

    void setState(int state) { this->state = stale; } //设置当前状态

    public:

    Door () :state (CLOSED) { };

    void getState() { //根据当前状态输出相应的字符串

    switch(state) {

    case OPENING: cout <<"OPENING" << endl; break;

    case CLOSED: cout << "CLOSED" << endl; break;

    case OPEN: cout << "OPEN" << endl; break;

    case CLOSING: cout << "CLOSING" << endl; break;

    case STAYOPEN: cout << "STAYOPEN" << endl; break;

    }

    }

    void click() { //发生click事件时进行状态转换

    if ( (1) ) setState(OPENING);

    else if ( (2) ) setState(CLOSING);

    else if ( (3) ) setState(STAYOPEN);

    }

    void timeout() { //发生timeout事件时进行状态转换

    if (state == OPEN) setState(CLOSING);

    }

    void complete() { //发生complete事件时进行状态转换

    if (state == OPENING) setState(OPEN);

    else if (state == CLOSING) setState(CLOSED);

    }

    };

    int main(){

    Door aDoor;

    aDoor.getState(); aDoor.click(); aDoor.getState(); aDoor.complete();

    aDoor.getState(); aDoor.click(); aDoor.getState(); aDoor.click();

    aDoor.getState(); return 0;

    }

    【C++代码2】

    class Door {

    public:

    DoorState *CLOSED, *OPENING, *OPEN, *CLOSING, *STAYOPEN, *state;

    Door();

    virtual ~Door() { ... //释放申请的内存,此处代码省略};

    void s


    正确答案:(1)state==CLOSED || state==CLOSING (2)state==OPENING || state==STAYOPEN (3)state==OPEN (4)state->click() (5)state->timeout() (6)state->complete() (7)door->setState(door->OPENING)
    (1)state==CLOSED || state==CLOSING (2)state==OPENING || state==STAYOPEN (3)state==OPEN (4)state->click() (5)state->timeout() (6)state->complete() (7)door->setState(door->OPENING) 解析:这是一道要求读者掌握状态转换图的程序设计与实现的综合题。本试题的解答思路如下。
    根据(1)空缺处所在的程序段给出的注释信息“发生click事件时进行状态转换”可知,(1)空缺处所在的方法为click,表示当发生click事件时应该发生什么状态转换。找出传输门响应事件与其状态转换图(见图6-18)与click事件相关的内容,并特别注意箭头所指的方向。由于发生click事件前的状态Closed、Closing分别跳转到状态Opening,因此(1)空缺处所填写的内容是“state == CLOSED || state == CLOSING”。
    同理,由如图6-18所示中的状态转换关系可知,发生click事件前的状态Opening、Stayopen分别跳转到状态Closing,即(2)空缺处所填写的内容是“state == OPENING || state == STAYOPEN”;发生click事件前的状态Open跳转到状态StayOpen,即(3)空缺处所填写的内容是“state == OPEN”。
    仔细阅读【C++代码2】程序段,由语句“private DoorState state=CLOSED;”可知,类Door的state成员变量用于记录类Door所处的状态,而state变量的类型为Doorstate*。由语句“virtual void click(){}”、“virtual void complete(){}”和“virtual void timeout(){}”可知,Doorstate中分别具有click、timeout和 complete方法用来响应对应的事件。根据(4)空缺处所在程序段“voidDoor::click()”可得,(4)空缺处所填写的内容是“state->click()”。
    同理,根据(5)空缺处所在程序段“void Door::timeout()”可得,(5)空缺处所填写的内容是“state->timeout()”:根据(6)空缺处所在程序段“void Door::complete()”可得,(6)空缺处所填写的内容是“state->complete()”。
    根据(7)空缺处所在程序段给出的注释信息“定义一个基本的Closed状态”和语句“void DoorClosed::click()”可知,(7)空缺处所填写的内容与传输门当前状态为Closed且发生Click事件时状态的迁移有关。结合如图6-18所示中的状态转换关系可知,在Click事件下Closed状态将迁移到Opening,因此(7)空缺处应该将传输门的状态设置为Opening。由于Doorstate变量存储了当前其存储的传输门的实例,因此可直接调用其方法setState设置状态。同时考虑到传输门的状态采用类的实例变量表示,故(7)空缺处所填写的内容为“door->setState(door->OPENING)”。

  • 第3题:

    When loading a tanker,you should ______.

    A.load only one tank at a time

    B.keep the seamen on watch on standby in the mess room

    C.keep a strain on the loading hoses

    D.close valves by closing them down,reopening one or two turns,and re-closing


    正确答案:D

  • 第4题:

    The boy lay in the street,his eyes_______and his hands______.

    A.closing;trembling
    B.closed;trembled
    C.closing;trembled
    D.closed;trembling

    答案:D
    解析:

  • 第5题:

    Using Job Scheduling Console, how can the external successor chain  be viewed when a job needs to be canceled?()

    • A、 using the Hyperbolic Viewer
    • B、 opening the Impact view and displaying the successors
    • C、 opening the Job Stream Instance editor for its Job Stream Instance
    • D、 opening the Dependencies window and drilling down to the successors

    正确答案:B

  • 第6题:

    单选题
    开关舱的工作通常是由船员来做。()
    A

    The work of opening and closing hatches is usually done by crew members.

    B

    The work of opening and closing hatch covers is usually done by crew members.

    C

    The work of opening hatch covers is usually done by crew members.

    D

    The work of closing hatch covers is usually done by crew members.


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

  • 第7题:

    单选题
    This company is closing up, so lots of workers will be laid _____.
    A

    down

    B

    out

    C

    off

    D

    aside


    正确答案: C
    解析:
    句意:这个公司要倒闭了,因此很多职工会下岗。考查固定短语的用法。lay off解雇。lay down放下,制定。lay out摆出,设计。lay aside把……搁置一旁。

  • 第8题:

    单选题
    After opening up the lid of a laptop that is powered on, nothing is displayed on the LCD. Opening and closing the lid multiple times usually causes the display to regain the signal. Which of the following components should the technician check FIRST?()
    A

    Motherboard

    B

    Video card

    C

    Cutoff switch

    D

    AC adapter


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

  • 第9题:

    单选题
    A well in the uppermost deck of a shelter deck vessel which has only a temporary means of closing for the purpose of gaining an exemption from tonnage measurement is called a(n)().
    A

    Exemption space

    B

    Tonnage deck

    C

    Cofferdam

    D

    Tonnage opening


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

  • 第10题:

    单选题
    —Do you mind_____?—Go ahead.
    A

    closing the window

    B

    your closing the window

    C

    my closing the window

    D

    I closing the window


    正确答案: D
    解析:
    句意:介意我关窗吗?不介意。mind doing sth.为固定词组,表示“介意做某事”,doing前常加形容词性物主代词,表示动作为某人所有。故C项正确。B项不符合句意。

  • 第11题:

    单选题
    When the heat load begins to increase, the needle valve of an expansion valve will()
    A

    move in an opening direction

    B

    move in a closing direction

    C

    either open or close

    D

    not move at all


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

  • 第12题:

    问答题
    翻译:the opening and closing of vessel’s hatches is to be performed by ship’s crew at owner’s expenses.

    正确答案: 开启和关闭船舶货舱工作应由船上人员操作,费用由船东负责
    解析: 暂无解析

  • 第13题:

    why is quick closing valves important to in engine room machineries ?how are they operated ?


    正确答案:These are pneumatically actuted valves ,hydraulic valves and hand actuated valves .they are used for the purpose of shutting and closing the valve down in remote position in case of fire or other emergency . In case of fire , a remote operated valve is actuated to supply control air leading to each valve .these valves are equipped with cylinders with rods which provide a means valve locking ,and control air supplied will activate the cylinder disengage the locking mechanism and shutting the valve .

  • 第14题:

    The nozzle of a gasoline hose or can should be kept ______.

    A.In contact with the fill opening to guard against static spark

    B.From making contact with the fill opening to guard against static spark

    C.In contact with the fill opening to allow proper venting

    D.None of the above


    正确答案:A

  • 第15题:

    在图示梁中,反力VE和VB的值应为:


    A.VE=P/4,VB=0
    B.VE=0,VB=P
    C.VE=0,VB=P/2
    D.VE=P/4,VB=P/2

    答案:B
    解析:
    提示:分清基本部分、附属部分。

  • 第16题:

    开关舱的工作通常是由船员来做。()

    • A、The work of opening and closing hatches is usually done by crew members.
    • B、The work of opening and closing hatch covers is usually done by crew members.
    • C、The work of opening hatch covers is usually done by crew members.
    • D、The work of closing hatch covers is usually done by crew members.

    正确答案:A

  • 第17题:

    单选题
    The opening or closing of the cylinder starting valve is controlled by ().
    A

    the starting air distributor

    B

    the cut-off valve on the air main

    C

    the main starting valve

    D

    the air bottle control valve


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

  • 第18题:

    单选题
    Using Job Scheduling Console, how can the external successor chain  be viewed when a job needs to be canceled?()
    A

     using the Hyperbolic Viewer

    B

     opening the Impact view and displaying the successors

    C

     opening the Job Stream Instance editor for its Job Stream Instance

    D

     opening the Dependencies window and drilling down to the successors


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

  • 第19题:

    单选题
    According to the customs of this port,the work of opening and closing hatch covers is done by ().
    A

    the ship's officers

    B

    the foreman from the shore

    C

    the ship's hands

    D

    the tally man


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

  • 第20题:

    单选题
    Before opening and closing the hatches, the spaces around the covers, all the parts and the gears should be ().
    A

    cleared

    B

    checked

    C

    removed

    D

    repaired


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

  • 第21题:

    单选题
    Icreasing the exhaust valve tappet clearance of a diesel engine will result in the exhaust valve opening ()
    A

    later and closing earlier

    B

    later and closing later

    C

    earlier and closing earlier

    D

    earlier and closing later


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

  • 第22题:

    单选题
    In an engine with air inlet valve and exhaust valve on its cylinder heads the fresh air will enter into the cylinder () and the gases exhaust (), there being an adequate overlap between the inlet opening and the exhaust closing.
    A

    downwards;upwards

    B

    upwards;downwards

    C

    downwards;downwards

    D

    upwards;upwards


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

  • 第23题:

    单选题
    The nozzle of a gasoline hose or can should be kept().
    A

    in contact with the fill opening to guard against static spark

    B

    from making contact with the fill opening to guard against static spark

    C

    in contact with the fill opening to allow proper venting

    D

    None of the above


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