版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- GB/Z 177.9-2026人工智能终端智能化分级第9部分:耳机
- 2021年西藏中考英语真题及解析
- 2026年物理安徽初赛试题及答案
- 深度解析(2026)《GBT 30030-2023自动导引车 术语》
- 《GBT 2423.40-2013环境试验 第2部分:试验方法 试验Cx:未饱和高压蒸汽恒定湿热》(2026年)合规红线与避坑实操手册
- 《DLT 5479-2022通信工程建设预算项目划分导则》(2026年)合规红线与避坑实操手册
- 2026年食品冷链运输协议
- 单片机原理及应用实践教程 课件全套 徐锋 第1-8章 单片机基本原理 -单片机应用系统设计
- 年产80台有机废弃物干式厌氧发酵罐项目可行性研究报告模板拿地申报
- 别墅大门防火门提档升级项目可行性研究报告模板拿地申报
- 2026中铁特货物流股份有限公司招聘毕业生78人笔试备考题库及答案解析
- 颅底重建术后脑脊液漏的分型与处理
- 夫妻关系大于一切课件
- 2026及未来5年中国射箭行业市场竞争格局及未来趋势研判报告
- 2025 七年级数学下册实数大小比较的特殊值代入法课件
- 《思想道德与法治》课件-4.7争做改革创新生力军
- 2025年卫校招生老师面试题库及答案
- 2025年AP考试物理C真题
- 2025课堂惩罚 主题班会:马达加斯加企鹅课堂惩罚 课件
- Maya 2024三维设计基础教程(全彩微课版) 课件全套 来阳 第1-10章 初识Maya 2024 -综合实例
- 售后服务部主管述职报告
评论
0/150
提交评论