题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-12-12 19:12:28

[单项选择]

针对下列程序段,需要()个测试用例可以满足分支覆盖的要求。
int IsLeap(int year)

if (year % 4==0)

if ( (year % 100==0)

if (year % 400==0)
leap=1;
else
leap=0;

else
leap=l;

else
leap=0;
return leap;


A. 3
B. 4
C. 6
D. 7

更多"针对下列程序段,需要()个测试用例可以满足分支覆盖的要求。 int I"的相关试题:

[单项选择]针对下列程序段,需要()个测试用例可以满足分支覆盖的要求。  int IsLeap(int year)  {  if ( year % 4 == 0 )  {  if ( ( year % 100 == 0 )  {  if ( year % 400 == 0 )  leap = 1;  else  leap = 0;  }  else  leap = 1;  }  else  leap = 0;  return leap;  }
A. 3
B. 4
C. 6
D. 7
[单项选择]

针对下列程序段,需要()个测试用例才可以满足语句覆盖的要求。
switch(value)

case 0:
other=30;
break;
case 1:
other=50;
break;
case 2:
other=300;
case 3:
other=other/value;
break;
default:
other=other * value;


A. 2
B. 3
C. 4
D. 5
[单项选择]针对以下程序段,对于变量 c 的取值,至少需要( )个测试用例才能够满足语句覆盖的要求。 c = ((u8_t *)q->payload)[i]; switch (c) { case SLIP_END: sio_send(SLIP_ESC, netif->state); sio_send(SLIP_ESC_END, netif->state); break; case SLIP_ESC: sio_send(SLIP_ESC, netif->state); sio_send(SLIP_ESC_ESC, netif->state); break; default: sio_send(c, netif->state); break; }
A. 4
B. 3
C. 2
D. 1
[单项选择]针对下列程序段,需要______个测试用例才可以满足语句覆盖的要求。
Switch(value)

Case 0:
Other=30;
Break;
Case 1:
Other=50;
Break;
Case 2:
Other=300;
Case 3;
Other=other/value;
Break;
Default:
Other=other * value;

A. 2
B. 3
C. 4
D. 5
[单项选择]若有以下程序段:
struct dent
int n;
int *m;

int a=1,b=2,c=3;
struct dent s[3]=101,&a,102,&b,103,&c;
struct dent *p=s;
则以下表达式中值为2的是( )。
A. (p++)->m
B. *(p++)->m
C. (*p).m
D. *(++p)->m
[单项选择]针对以下 C 语言程序段,对于(MaxNum,Type)的取值,至少需要( )个测试用例能够满足判定覆盖的要求。 while ( MaxNum-- > 0 ) { if ( 10 == Type ) x = y * 2; else if ( 100 == Type ) x = y + 10; else x = y - 20; }
A. 5
B. 4
C. 3
D. 2
[单项选择]若有以下程序段:
struct st
int n;
int*m:

int a=2,b=3,c=5;
struct st s[3]=(101,&a,102,&c,103,&b);
main( )
struct st*p;
p=s;

则以下表达式中值为5的是()。
A. (*p).m
B. *(p+1)->m
C. *(p++)->n
D. (p++)(*m)
[单项选择]有以下程序段:
struct st
int x; int * y; * pt;
int a[] = 1,2 ,b[] = 3,4;
struct st c[2] = 10,a,20,b;
pt=c;
以下选项中表达式的值为11的是()。
A. *pt->y
B. pt->x
C. ++pt->x
D. (pt++)->x
[填空题]执行如下程序段后,int sum的值为______。 Private SubCommand1_Click( ) sum=0 For i=1 To 18 Step 2 For j=2 To 6 If (i Modj)<>0 Then sum=sum+j Next Next Print sum End Sub
[单项选择]

针对以下C语言程序段,假设sta[10]=-1,对于x的取值,需要()个测试用例能够满足分支覆盖的要求。
int MathMine(int x)

int m=0;
int i;
for(i=x-1; i<=x+1; i++)

if (i<0) continue;
if (i>31) break;
if (sta[i]=-1) m++;

return m;


A. 3
B. 4
C. 5
D. 6
[单项选择]有以下程序段:
struct st
int x; int *y; ) *pt;
int a[]=1, 2), b[]=3, 4);
struct st c[2]=10, a, 20, b;
pt=c;
以下选项中表达式的值为11的是( )。
A. *pt->y
B. pt->x
C. ++pt->x
D. (pt++) ->x
[单项选择]设有以下程序段,则
int x=0,s=0;
while(!x!=0)s+=++x;
printf("%d",s);
A. 运行程序段后输出0
B. 运行程序段后输出1
C. 程序段中的控制表达式是非法的
D. 程序段执行无限次
[单项选择]有下列程序段:
struct st
int x;int *y;*pt;
int a[]=1,2,b[]=3,4;
struct st c[2]=10,a,20,b;
pt=c;
下列选项中表达式的值为11的是( )。
A. *pt->y
B. pt->x
C. ++pt->x
D. (pt++)->X
[单项选择]有下列程序段:
struct St
int x;int *y;)*pt;
int a[]=1,2),b[]=3,4);
struct st c[2]=10,a,20,b);
pt=c;
下列选项中表达式的值为11的是()。
A. *pt- >y
B. pt- >x
C. + +pt- >x
D. (pt+ +)->x
[单项选择]设有程序段;"int a=7,b=2,c=2,d;float x=5,y;y=a/b/c;d=x/c;",则y和d的值分别是()。
A. 1. 75 2.5
B. 1.75 2
C. 1.0 2.5
D. 1.0 2

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

截图扫码使用小程序[完全免费查看答案]
请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码