版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026广东东莞市发展和改革局招聘编外聘用人员8人笔试备考题库及答案解析
- 2026浙江金华市永康市统计局工作人员招聘1人笔试模拟试题及答案解析
- 2026年广西体育高等专科学校单招职业技能测试题库附参考答案详解(模拟题)
- 2026中国科学院上海应用物理研究所财务与资产处“出纳”岗位招聘1人笔试模拟试题及答案解析
- 2026年常州机电职业技术学院单招职业技能考试题库附答案详解(培优)
- 2026年山西省财政税务专科学校单招职业适应性测试题库附答案详解(达标题)
- 2026甘肃武威市凉州区永丰镇招聘专业化管理大学生村文书1人考试参考题库及答案解析
- 2026年哈尔滨南岗区保健路哈西新区社区卫生服务中心招聘5人笔试备考试题及答案解析
- 2026年四川信息职业技术学院单招职业适应性考试题库带答案详解(基础题)
- 2026河南濮阳两级法院招聘聘用制书记员127人笔试模拟试题及答案解析
- 原始社会儿童教育
- 洗衣店和单位洗衣合同范本
- 高中英语单选题100道及答案
- 上海2024年高考英语试卷
- 化工设计知到智慧树章节测试课后答案2024年秋浙江大学
- 2024商铺转租转让合同
- DB13(J)T 8446-2021 建筑施工安全技术资料管理标准
- 2024-2030年中国寺庙经济市场运行态势与发展战略建议报告
- 小学安全监督检查工作计划
- 体育统计学复习题库
- 雨水节气课件
评论
0/150
提交评论