



版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、姓名:_ 班级:_ 学号:_-密-封 -线- 软件测试工程师问答集考试.卷模拟考试题考试时间:120分钟 考试总分:100分题号一二三四五总分分数遵守考场纪律,维护知识尊严,杜绝违纪行为,确保考试结果公正。1、以下是一个自动饮料售货机软件的操作规格说明,请按要求回答问题。设要对一个自动饮料售货机软件进行黑盒测试。该软件的规格说明如下:“有一个处理单价为1元5角钱的盒装饮料的自动售货机软件。若投入1元5角硬币,按下“可乐”、“雪碧”或“红茶”按钮,相应的饮料就送出来。若投入的是2元硬币,在送出饮料的同时退还5角硬币。”试利用因果图法,建立该软件的因果图。 ( )2、以下是一个自动饮料售货机软件的
2、操作规格说明,请按要求回答问题。设要对一个自动饮料售货机软件进行黑盒测试。该软件的规格说明如下:“有一个处理单价为1元5角钱的盒装饮料的自动售货机软件。若投入1元5角硬币,按下“可乐”、“雪碧”或“红茶”按钮,相应的饮料就送出来。若投入的是2元硬币,在送出饮料的同时退还5角硬币。”设计测试该软件的全部测试用例。 ( )3、针对以下c语言程序,请按要求回答问题。已知link. c源程序如下:/*link. c程序对单向链表进行操作,首先建立一个单向链表,然后根据用户的选择可以对其进行插入结点、删除结点和链表反转操作*/#includestdio. h#includestdlib. htypede
3、f struct list_node * list_pointer; /定义链表指针typedef struct list_node /定义链表结构int data;list_pointer link;list_node;/用到的操作函数list_pointer create( ); /建立一个单向链表void insert(list_pointer * p_ptr,list_pointer node); /在node后加入一个新的结点void delete_node(list_pointer * p_ptr,list_pointer trail,list_pointer node);/删除前
4、一个结点是trail的当前结点nodevoid print(list_pointer * p_ptr); /打印链表结点中的值list_pointer invert(list_pointer lead); /反转链表int main( )list_pointer ptr=null;list_pointer node,trail;list_pointer * p=ptr;int choose,location,i;printf(“you should create a link first:/n”);/建立一个单向链表prt=create( ); /ptr指向链表的第一个结点print(ptr)
5、;/根据用户的不同选择进行相应的操作:printf(“input number 0,you can quit the program/n”);printf(“input number 1,you can insert a new node to link/n”):printf(“input number 2,you can delete a node from the link/n”);printf(“input number 3,you can invert the link/n”):printf(“please input you choice/n”);scanf(“%d”,choose)
6、;while(choose!=0)switch(choose)case 1:i=1:while(ilocation)node=node-link;i+:insert(p,node); /p为指向ptr的指针print(ptr);break;case 2:printf(“you will delete a node from the link/n”);printf(“please input the location of the node:/n”);scanf(“%d”,&location):node=ptr;if(location=1)trail=null;trail=ptr;i=1:whi
7、le(ilocation)trail=trail-link:i+:node=trail-link;delete_node(p,trail,node);print(ptr);break;case 3:printf(“you will invert the link/n”);ptr=invert(ptr);print(ptr);break;default;break;return -1;printf(“please input you choice/n”);scanf(“%d”. choose):return 0;/根据用户的输入值建立一个新的单向链表:list_pointer create( )
8、int i,current,length;list_pointer p1,p2,head;printf(“please input the node number of the link:/n”);scanf(“%d”. length):printf(“the number of the link is:%d”,length);printf(“please input the data for the link node:/n”);i=0;p1=p2=(list_pointer)malloc(sizeof(list_node);head=p1;for(i=1;ilength;i+)scanf(
9、“%d”,current);p1-data=current;p2-link=p1;p2=p1;p1=(list_pointer)malloc(sizeof(list_node);p2-link=null;return head;画出主函数main的控制流程图。 ( )4、针对以下c语言程序,请按要求回答问题。已知link. c源程序如下:/*link. c程序对单向链表进行操作,首先建立一个单向链表,然后根据用户的选择可以对其进行插入结点、删除结点和链表反转操作*/#includestdio. h#includestdlib. htypedef struct list_node * list_
10、pointer; /定义链表指针typedef struct list_node /定义链表结构int data;list_pointer link;list_node;/用到的操作函数list_pointer create( ); /建立一个单向链表void insert(list_pointer * p_ptr,list_pointer node); /在node后加入一个新的结点void delete_node(list_pointer * p_ptr,list_pointer trail,list_pointer node);/删除前一个结点是trail的当前结点nodevoid pr
11、int(list_pointer * p_ptr); /打印链表结点中的值list_pointer invert(list_pointer lead); /反转链表int main( )list_pointer ptr=null;list_pointer node,trail;list_pointer * p=ptr;int choose,location,i;printf(“you should create a link first:/n”);/建立一个单向链表prt=create( ); /ptr指向链表的第一个结点print(ptr);/根据用户的不同选择进行相应的操作:printf(
12、“input number 0,you can quit the program/n”);printf(“input number 1,you can insert a new node to link/n”):printf(“input number 2,you can delete a node from the link/n”);printf(“input number 3,you can invert the link/n”):printf(“please input you choice/n”);scanf(“%d”,choose);while(choose!=0)switch(ch
13、oose)case 1:i=1:while(ilocation)node=node-link;i+:insert(p,node); /p为指向ptr的指针print(ptr);break;case 2:printf(“you will delete a node from the link/n”);printf(“please input the location of the node:/n”);scanf(“%d”,&location):node=ptr;if(location=1)trail=null;trail=ptr;i=1:while(ilocation)trail=trail-l
14、ink:i+:node=trail-link;delete_node(p,trail,node);print(ptr);break;case 3:printf(“you will invert the link/n”);ptr=invert(ptr);print(ptr);break;default;break;return -1;printf(“please input you choice/n”);scanf(“%d”. choose):return 0;/根据用户的输入值建立一个新的单向链表:list_pointer create( )int i,current,length;list_pointer p1,p2,head;printf(“please input the node number of the link:/n”);scanf(“%d”. length):printf(“the number of the link is:%d”,length);printf(“please input the data for the link node:/n”);i=0;p1=p2=(list_pointer)malloc(sizeof(list
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 地震用品储备管理办法
- 客房服务服务管理办法
- 诉讼保全业务管理办法
- 签订框架协议管理办法
- 工业电气知识培训课件
- 高起专2024数学试卷
- 观察记录中班数学试卷
- 皋城2024年小升初数学试卷
- 夺冠五年级上册数学试卷
- 梵蒂冈数学试卷
- 电气安全专项隐患排查治理要点课件
- 《马克思主义与社会科学方法论》1-7章思考题答案
- 设备润滑培训课件
- 学生床上用品采购投标方案
- 《社会网络分析法》课件
- 银行基础知识详解
- 散热器安装施工方案与技术措施
- 在线语言学习行业竞争格局分析
- 第十四讲 建设巩固国防和强大人民军队PPT习概论2023优化版教学课件
- 山东工商学院金融学期末复习题及参考答案
- 国开2023年春《理工英语1》机考网考期末复习资料参考答案
评论
0/150
提交评论