Mark is a clerk( )a job in a top bookstore.A、inB、withC、toD、for

题目
Mark is a clerk( )a job in a top bookstore.

A、in

B、with

C、to

D、for


相似考题

3.●试题四阅读下列程序说明和C代码,将应填入(n)处的字句写在答题纸的对应栏内。【程序4.1说明】"背包问题"的基本描述是:有一个背包,能盛放的物品总重量为S,设有N件物品,其重量分别为w1,w2,...,wn,希望从N件物品中选择若干件物品,所选物品的重量之和恰能放入该背包,即所选物品的重量之和等于S。如下程序均能求得"背包问题"的一组解,其中程序4.1是"背包问题"的递归解法,而程序4.2是"背包问题"的非递归解法。【程序4.1】#include<stdio.h>#define N 7#define S 15int w[N+1]={0,1,4,3,4,5,2,7};int knap(int s,int n){ if(s==0)return 1;if (s<0||(s>0& &n<1))return 0;if( (1) )){printf(″%4d″,w[n]);return 1;}return (2) ;}main(){if( knap(S,N))printf(″OK!\n″);else printf(″N0!\n″);}【程序4.2】#include<stdio.h>#define N 7#define S 15typedef struct {int s;int n:int job;} KNAPTP;int w[N+1]={0,1,4,3,4,5,2,7};int knap (int s,int n);main( ) {if (knap (S,N)) printf (″OK!\n″);else printf (″NO!\n″);}int knap (int s,int n){ KNAPTP stack[100],x;int top,k,rep;x.s=s;x.n=n;x.job=0;top=l;stack[top]=x;k=0;while( (3) ) {x=stack [ top ];rep=1;while ( !k && rep ) {if (x.s==0)k=1;/*已求得一组解*/else if (x.s<0 || x.n <=0)rep=0;else{x.s= (4) ;x.job=1;(5) =x;}}if(!k){rep=1;while(top>=1&&rep){x=stack[top--];if(x.job==1){x.s+=w[x.n+1];x.job=2;stack[++top]=x;(6) ;}}}}if(k){/*输出一组解*/while(top>=1){x=stack[top--];if(x.job==1)printf(″%d\t″,w[x.n+1]);}}return k;}

参考答案和解析
正确答案:B
更多“Mark is a clerk( )a job in a top bookstore. ”相关问题
  • 第1题:

    阅读下列程序说明和C++代码,将应填入(n)处。

    【说明】

    “背包问题”的基本描述是:有一个背包,能盛放的物品总重量为S,设有N件物品,其重量分别为w1;w2,……,wn,希望从N件物品中选择若干件物品,所选物品的重量之和恰能放入该背包,即所选物品的重量之和等于S。

    如下程序均能求得“背包问题”的一组解,其中程序4.1是“背包问题”的递归解法,而程序4.2是“背包问题”的非递归解法。

    【程序4.1】

    include<stdio.h>

    define N 7

    define S 15

    int w[N+1]={0,1,4,3,4,5,2,7};

    int knap(int s,int n)

    { if(s==0)return 1;

    if(s<0||(s>0& &n<1))return 0;

    if((1)))|

    printf("%4d",w[n]);return 1;

    } return (2);

    }

    main(){

    if(knap(S,N))printf("OK!\n");

    else printf("NO!\n");

    }

    【程序4.2】

    include<stdio.h>

    define N 7

    define S 15

    typedef struct{

    int s;

    int n:

    int job;

    } KNAPTP;

    int w[N+1]={0,1,4,3,4,5,2,7};

    int knap(int s,int n);

    main(){

    if(knap(S,N))printf("OK!\n");

    else printf("NO!\n");}

    int knap(int s,int n)

    { KNAPTP stack[100],x;

    int top,k,rep;

    x.s=s;x.n=n;

    x.job=0;

    top=|;Stack[top]=x;

    k=0;

    while((3)){

    x=Stack[top];

    rep=1;

    while(!k && rep){

    if(x.s==0)k=1;/*已求得一组解*/

    else if(x.s<0||x.n <=0)rep=0;

    else{x.s=(4);x.job=1;

    (5)=x;

    }

    }

    if(!k){

    rep=1;

    while(top>=1&&rep){

    x=stack[top--];

    if(x.job==1){

    x.s+=W[x.n+1];

    x.job=2;

    Stack[++top]=x;

    (6);

    }

    }

    }

    }

    if(k){/*输出一组解*/

    while(top>=1){

    x=staCk[top--];

    if(x.job==1)

    printf("%d\t",w[x.n+1]);

    }

    }

    return k;

    }


    正确答案:(1)knap(s-w[n]n-1)(2)knap(sn-1)(3)top>=1 && ! k 或 top>0 && k==0(4)x.s-w[x.n--](5)stack[++top](6)rep=0
    (1)knap(s-w[n],n-1)(2)knap(s,n-1)(3)top>=1 && ! k 或 top>0 && k==0(4)x.s-w[x.n--](5)stack[++top](6)rep=0 解析:试题提供了两种解决问题的方法,程序5.1是用递归的方法来解决背包问题,程序5.2使用非递归的方法来解决背包问题。每次选择一个物品放入背包,那么剩余的物品和背包剩余的重量,又构成一个“背包问题”。程序从数组下标最大的物品开始考查,因此(1)处应该填“knap(s-w[n],n-1)”,即将数组中第N个物品放入背包,如果它能够放入到背包中,则该物品是构成解的元素之一;否则,将该物品从背包中取出,该物品不构成解的元素,在以后的考查中,它可以被排除,因此(2)处应该填“knap(s,n-1)”。在改程序中用栈来保存已经考查过的物品,结构KNAPTP表示经过考查的物品,s表示考查过该物品后背包所能够盛放的物品的重量;n表示该物品在数组W中的下标;job表示物品当前的状态:当job等于1,表示物品n可以放入背包; job等于2表示物品n不能被放入到背包,那么在以后的选取中将不再考虑该物品。初始时job等于0,表示背包中没有任何放入任何物品。 K为有解的标志。Rep为一个标志变量,rep等于0,表示结束当前的动作;rep等于1表示继续进行当前的动作。当栈顶物品不能放入背包时,将rep设置为0,表示下一步不从数组w中取物品。其初值为1。开始时,将数组中下标最大的物品放入栈中,然后开始考查该物品。该物品满足放入背包的条件,第(4)(5)空将完成将物品放入背包的操作,因此(4)空填“x.s-w[x.n--]”,修改背包的可容纳物品的重量; (5)处填"stack[++top]",将下一个要考查的物品放入栈中。若该物品不满足放入背包的条件,则将该物品从背包中取出,因此将rep置为 0,结束循环while(! k&&rep)。将物品从背包中取出,即释放该物品在背包中所占的重量,并标记为不能放入到背包(job=2),再将其放入到栈中;然后继续考查数组w中的下一个物品,因此需要结束循环while (top>=1 &&rep),将rep置为0,所以第(6)处应该填“rep=0”。在第三处要求给出循环结束的条件,即可以继续选取物品的条件,在此处填“top>=1&&!k”。

  • 第2题:

    Examine the data in the EMPLOYEES table.EMPLOYEESEMP_NAME DEPT_ID MGR_ID JOB_ID SALARYEMPLOYEE_ID101 Smith 20 120 SA_REP 4000102 Martin 10 105 CLERK 2500103 Chris 20 120 IT_ADMIN 4200104 John 30 108 HR_CLERK 2500105 Diana 30 108 IT_ADMIN 5000106 Smith 40 110 AD.ASST 3000108 Jennifer 30 110 HR_DIR 6500110 Bob 40 EK_DIR 8000120 Revi 20 110 SA_DIR 6500On the EMPLOYEES table, EMPLOYEE_ID is the primary key. MGR_ID is the ID of managers and refers to the EMPLOYEE_ID. The JOB_ID column is a NOT NULL column.Evaluate this DELETE statement:DELETE employee_id, salary, job_idFROM employeesWHERE dept_id = 90;Why does the DELETE statement fail when you execute it?()

    A. There is no row with dept_id 90 in the EMPLOYEES table.

    B. You cannot delete the JOB_ID column because it is a NOT NULL column.

    C. You cannot specify column names in the DELETE clause of the DELETE statement.

    D. You cannot delete the EMPLOYEE_ID column because it is the primary key of the table.


    参考答案:C

  • 第3题:

    设有一组作业,它们的作业提交时刻及估计运行时间如下所示: 作业号 提交时刻 估计运行时间(分钟) Job1 8:30 70 Job2 9:10 30 Job3 9:30 15 Job4 9:50 5 在单道批处理方式下,采用短作业优先调度算法,作业的执行顺序为

    A.Job1,Job4,Job3,Job2

    B.Job1,Job3,Job4,Job2

    C.Job4,Job3,Job2,Job1

    D.Job4,Job1,Job2,Job3


    正确答案:B
    解析:本题考查短作业优先调度算法的概念。短作业(进程)优先调度算法是指对短作业或短进程优先调度的算法。它们可以分别用于作业调度和进程调度。短作业优先调度算法,是从后备队列中选择一个或若干个估计运行时间最短的作业,将它们调入内存运行。而短进程优先调度算法,则是从就绪队列中选出一估计运行时间最短的进程,将处理机分配给它,使它立即执行并一直执行到完成,或发生某事件而被阻塞放弃处理机时,再重新调度。进程首先执行的是Job1,该作业到9:40完成,此时Job2和Job3在等待队列中,按照短作业调度算法,此时执行Job3。Job3在10:10,此时等待队列中有Job2和Job4作业,此时执行Job4,最后执行Job2。正确答案为选项B。

  • 第4题:

    CLERK: Hello, Big City Electricity, how may I help you today

    PETERS:__1__.

    CLERK: May I have your account number

    PETERS: Certainly, it’s 4392107.

    CLERK: Thank you, is this Mr. Peters

    PETERS: Yes, this is Mr. Peters.

    CLERK: Thank you. What can I help you with

    PETERS: ___2_.

    CLERK: I’m sorry to hear that___2_.

    PETERS: The bill is 300% higher than last month.

    CLERK: Terribly sorry for that. Let me ask you a few questions and then I’ll see what I can do.

    PETERS: OK, Thank you for your help.

    CLERK: Of course, thank you for calling this to our attention. Now, how much do you usually pay for your electricity

    PETERS: I usually pay about $50 a month.

    CLERK: Thank you.___4_

    PETERS: $200. I can’t understand why.

    CLERK: Yes, Mr. Peters. Was your usage different in any way

    PETERS: No, it was an average month.

    CLERK: I’m sorry there certainly seems to be a mistake.

    PETERS: Well, I’m happy you agree with me.

    CLERK: I’ll contact a service representative. And what’s your phone number

    PETERS: 408-533-0875

    CLERK:___5_. We’ll do our best to change this as quickly as possible. PETERS: Thank you for your help in clearing this up.

    A. I think I’ve been overcharged for the past month.

    B. I’m terribly sorry about the mistake.

    C. I’m calling concerning my electricity bill.

    D. And how much did we charge on this bill

    E. Why do you think we charged you too much


    参考答案:子问题 1:C; 子问题 2:A; 子问题 3:E; 子问题 4:D; 子问题 5:B

  • 第5题:

    Examine the data in the EMPLOYEES and EMP_HIST tables:EMPLOYEESNAME DEPT_ID MGR_ID JOB_ID SALARYEMPLOYEE_ID101 Smith 20 120 SA_REP 4000102 Martin 10 105 CLERK 2500103 Chris 20 120 IT_ADMIN 4200104 John 30 108 HR_CLERK 2500105 Diana 30 108 IT_ADMIN 5000106 Smith 40 110 AD_ASST 3000108 Jennifer 30 110 HR_DIR 6500110 Bob 40 EX_DIR 8000120 Ravi 20 110 SA_DIR 6500EMP HISTEMPLOYEE_ID NAME JOB_ID SALARY101 Smith SA_CLERK 2000103 Chris IT_CLERK 2200104 John HR_CLERK 2000106 Smith AD_ASST 3000108 Jennifer HR_MGR 4500The EMP_HIST table is updated at the end of every year. The employee ID, name, job ID, and salary of each existing employee are modified with the latest data. New employee details are added to the table.Which statement accomplishes this task?()

    A. UPDATE emp_hist SET employee_id, name, job_id, salary = (SELECT employee_id, name, job_id, salary FROM employees) WHERE employee_id IN (SELECT employee_id FROM employees);

    B. MERGE INTO emp_hist eh USING employees e ON (eh.employee_id = e.employee_id) WHEN MATCHED THEN UPDATE SET eh.name = e.name, eh.job_id = e.job_id, eh.salary = e.salary WHEN NOT MATCHED THEN INSERT VALUES (e.employee id, e.name, job id, e.salary);

    C. MERGE INTO emp_hist eh USING employees e ON (eh.employee_id = e.employee_id) WHEN MATCHED THEN UPDATE emp hist SET eh.name = e.name, eh.job_id = e.job_id, eh.salary = e.salary WHEN NOT MATCHED THEN INSERT INTO emp_hist VALUES (e.employees_id, e.name, e.job_id, e.salary);

    D. MERGE INTO emp_hist eh USING employees e WHEN MATCHED THEN UPDATE emp_hist SET eh.name = e.name, eh.job_id = e.job_id, eh.salary = e.salary WHEN NOT MATCHED THEN INSERT INTO emp_hist VALUES (e.employees_id, e.name, e.job_id, e.salary);


    参考答案:B

  • 第6题:

    翻译以下关于邮政储蓄国内回执业务有关对话。 ①Clerk: Do you need A.R Service? ②Customer: How about the service charge? ③Clerk:One yuan for SMS service. ④ Customer: All right. ⑤Clerk: Please write down your mobile phone number here. We will inform you when the money arrives there. Thank you.
    ①您需要回执服务吗? ②费用是多少钱? ③短信回执每笔一元。 ④好吧。 ⑤请写下您的手机号码。汇款寄达后,我们会电话通知您。谢谢!