版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025云南基投公司社会招聘12人笔试历年典型考点题库附带答案详解2套试卷
- 2025中铝(云南)绿色先进铝基材料有限公司面向中铝股份内部招聘224人笔试参考题库附带答案详解
- 2025中国远洋海运集团天津地区招聘37人笔试参考题库附带答案详解
- 2025中国能建葛洲坝集团北方分公司招聘20人(湖北)笔试参考题库附带答案详解
- 2025中国水电基础局有限公司招聘(30人)笔试参考题库附带答案详解
- 2025中国广电山东网络有限公司市县公司招聘145人笔试参考题库附带答案详解
- 2025中国国新资产管理有限公司相关岗位招聘4人笔试历年常考点试题专练附带答案详解2套试卷
- 新员工培训中的礼仪知识
- 安全宣传课件
- 新员工信贷业务培训课件
- 2025年高职室内艺术设计(室内设计)试题及答案
- 2025课堂惩罚 主题班会:马达加斯加企鹅课堂惩罚 课件
- 2025年初会职称《经济法基础》真题汇编
- Zippo2024美版年册完整版
- 统计学的假设检验课件
- DB4228∕T 59-2021 马铃薯晚疫病田间抗性鉴定技术规程
- 沪教版(2024)七年级英语下册单词默写单背诵版
- 2025年宜昌化学真题试卷及答案
- 医疗质量安全培训计划
- 开工第一课安全生产培训内容
- 2025年研究生招生学科专业代码册
评论
0/150
提交评论