版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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芜湖护理面试题及答案大全
- 2026咸阳幼教面试题目及答案
- 2026消防救援员面试题及答案
- 2026新乡银行面试题目及答案
- 医院门诊综合楼装修工程施工方案
- 水路(船舶)运输合同范文
- 营业员劳动合同书
- 2026年矿山设备故障AI诊断技术
- 2026年工业质检数字化升级:AI算法与传统检测技术的融合路径
- 跨部门协作会议纪要模板及行动计划
- 家庭触电事故案例分析
- 社区食堂规范运营制度范本
- 2025年教师招聘考试必考的351个教育综合基础知识 (超强)
- GB/T 39693.4-2025硫化橡胶或热塑性橡胶硬度的测定第4部分:用邵氏硬度计法(邵尔硬度)测定压入硬度
- 《电子信息产品名称编码规则编制说明》
- 电铲知识学习培训课件
- 江门市重点行业领域安全风险常见隐患识别及整改指引(行业领域)(压缩版)
- 发改价格〔2007〕670号建设工程监理与相关服务收费标准
- 金融产品路演
- 融入AI技术的2024版《荷塘月色》教学课件发布
评论
0/150
提交评论