题目详情
当前位置:首页 > 计算机考试 > 软件测试工程师
题目详情:
发布时间:2023-10-22 16:47:07

[简答题]

下面是一段C程序,其功能为计算1到所输入数值的逐步累加和,请阅读程序并完成要求。
#include<stdio.h>
int sum(int);
void main( )

int num,k;
printf("Enter a number:");
seanf("%d",&num);
for(k=1;k<=num;k++)
printf("1 to %d is %d/n",k,sum(k));

int sum(int n)

int i,result=0;
for(i=1;i<=n;i++)
result+=i;
return result;
 

请画出此程序各函数的控制流程图。

更多"下面是一段C程序,其功能为计算1到所输入数值的逐步累加和,请阅读程序并"的相关试题:

[简答题]

下面是一段C程序,其功能为计算1到所输入数值的逐步累加和,请阅读程序并完成要求。
#include<stdio.h>
int sum(int);
void main( )

int num,k;
printf("Enter a number:");
seanf("%d",&num);
for(k=1;k<=num;k++)
printf("1 to %d is %d/n",k,sum(k));

int sum(int n)

int i,result=0;
for(i=1;i<=n;i++)
result+=i;
return result;
 

请画出此程序各函数的控制流程图。
[单项选择]

听下面一段对话,回答下列问题。
 

听下面一段对话,回答下列问题。

听下面一段对话,回答下列问题。
W: Hi, Bill, can you tell me how it happened
M: Sure. I was mountain climbing in New Hampshire in 1982. Suddenly the weather became really bad. There was a lot of snow and we couldn’t see anything. We got lost. Well, we spent four days on the mountain. The temperature was 20 degrees below zero, We didn’t have any equipment or food.
W: So what happened I guess someone found you, right
M: Yes, but we were very sick. I couldn’t move my legs because of the cold. f spent two months in the hospital. The doctors removed my legs.
W: Right. So you lost your legs, but you want to try your best to stay active.
M: That’s right. In fact, I decided to make some new legs for myself. I realized that no one had to be physically disabled. We can use modern technology to help us.
W: And you built these great new legs. Can you go mountai
A. Design new climbing shoes.
B. Establish a club for the disabled.
C. Use technology to fight his disability.

[单项选择]

听下面一段对话,回答下列问题。
 

听下面一段对话,回答下列问题。
W: Hi, Bill, can you tell me how it happened
M: Sure. I was mountain climbing in New Hampshire in 1982. Suddenly the weather became really bad. There was a lot of snow and we couldn’t see anything. We got lost. Well, we spent four days on the mountain. The temperature was 20 degrees below zero, We didn’t have any equipment or food.
W: So what happened I guess someone found you, right
M: Yes, but we were very sick. I couldn’t move my legs because of the cold. f spent two months in the hospital. The doctors removed my legs.
W: Right. So you lost your legs, but you want to try your best to stay active.
M: That’s right. In fact, I decided to make some new legs for myself. I realized that no one had to be physically disabled. We can use modern technology to help us.
W: And you built these great new legs. Can you go mountain climbing again
M:
A. Low temperature.
B. Terrible weather.
C. An unsuccessful operation.

[简答题]下面是一段C程序,其功能为计算1到所输入数值的逐步累加和,请阅读程序并完成要求。
#include<stdio.h>
int sum(int);
void main( )

int num,k;
printf("Enter a number:");
seanf("%d",&num);
for(k=1;k<=num;k++)
printf("1 to %d is %d/n",k,sum(k));

int sum(int n)

int i,result=0;
for(i=1;i<=n;i++)
result+=i;
return result;

设计一组测试用例,使该程序所有函数的语句覆盖率和分支覆盖率均能达到100%。如果认为该程序的语句或分支覆盖率无法达到100%,说明原因。
[单项选择]

下面是一段javabean程序,该程序的运行结果是()。
public class NullTest
public static void main(String[] args)
int M = 0;
String str = null;
StringBuffer sb = new StringBuffer("= ");
sb.append(str);
sb.append(M++);
System.out.println(sb.toString( ));


A. =null
B. =null0
C. =null1
D. =nullM
[简答题]阅读下面一段Visual Basic程序:在窗体上建立一个文本框,其名称为Textl,在属性窗口中把该文本框的MultiLine属性设置为True,然后编写如下的事件过程: Private Sub Form Click( ) Open"d:/test/smtext1.txt"For Input As#1 Do While Not ____(①)____ Line Input#1,aspect$ whole $=whole $+aspect $+Chr $(13)+Chr $(10) Loop Text1.Text=whole $ Close#1 Open"d:/test/smtext2.txt"For Output As#1 Print#1, ____(②)____ Close#1 End Sub 上述程序的功能是:把磁盘文件smtext1.txt的内容读到内存并在文本框中显示出来,然后把该文本框中的内容存入磁盘文件smtext2.txt。请完成①②空。
[填空题]下面一段程序定义了一个名字为“books”的记录,其4个域的域名及数据类型如下:
域名 数据类型 数据长度
title 字符型 40
author 字符型 20
price 单精度实型 10
请将下面 【11】 补充完整。
Type books
title As String*40
author As string*20
Price 【11】
End Type
[单项选择]下面一段小程序是判断一个长度为n的字符数组是否中心对称。例如,“abcddcba”或“abcdcba”就是中心对称。作为内部边界值,应填入( )内的判断是______。
Bool center-sym(char S[], int n)
//判断字符组S中的n各字符是否中心对称。若是则函数返回true,否则返回false
Int i=1, j=n
while( )
If(s[i-1]!=s[j-1]) return false; //i,j从1开始计数,数组从0开始
Elsei=i+1; j=j-1;
Return true;
A. i<j
B. i==j(判等)
C. i>j
D. i!=j(判不等)
[填空题]下面一段程序的功能是,单击命令按钮后将D盘temp 目录下的staff.txt 文件内容读出,并在文本框Text1中显示出来。请填空。 Private Sub Command1_ Click( ) Dim Line As String, FileNo As Integer Dim People As String FileNo = FreeFile Open "D:/temp/staff.txt" For Input As ______ DO While Not ______ Line Input #FileNo, Line People = People + Line + Chr(13) + Chr(10) Loop Text1.Text = People End Sub
[填空题]下面一段程序要实现的功能是:在内存中从地址source开始有一个长度为100的字符串,测试该字符串中是否存在数字,如有则将DL的第五位置1,否则将该位置0。
BEGIN: MOV CX,100
MOV SI,0
REPEAT: MOV SOURCE[SI]
CMP AL,30H
JB GOON
GMP AL, 【7】
JA GOON
OR DL,20H
JMP EXIT
GOON: INC SI
LOOP REPFATI
AND DL,00FH
EXIT:

我来回答:

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

订单号:

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