A、in
B、with
C、to
D、for
第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;
}
第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.
第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
第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
第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);
第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.
①您需要回执服务吗? ②费用是多少钱? ③短信回执每笔一元。 ④好吧。 ⑤请写下您的手机号码。汇款寄达后,我们会电话通知您。谢谢!
略