填空题
[问题2] 用边界值分析法设计测试用例,检查逻辑覆盖标准。
【参考答案】
用边界值法设计测试用例,见下表:
边界值法设计测试用例表
(↓↓↓ 点击下方‘点击查看答案’看完整答案 ↓↓↓)
点击查看答案
<上一题
目录
下一题>
热门
试题
填空题
[说明] 假设二叉树采用连接存储结构进行存储,root 指向根接点,p 所指结点为任一给定的结点,编写一个求从根结点到p所指结点之间路径的函数。 void path (root, p) btree * root, * p; Btree *stack[m0], *s; int tag[m0], top =0, i, find =0; s =root; do while (s ! = NULL) stack [top] = s; tag[top] =0; ( (1) ) if (top >0) ( (2) ) if (tag[top] = =1) if( (3) ) for (i=1; i< =top; i+ + printf ( %d ,stack[i]- >data); find=1; else top - -; if( (4) ) p=p- >right; ( (5) ) while (find || (s! = NULL && top ! =0));
点击查看答案&解析
填空题
[说明] 从键盘输入一个字符ch,输出该字符在文本文件input.txt 的每一行中出现的次数。(必须调用函数鳋统计ch的出现次数,函数ff (str,ch)的功能是统计并返回字符ch在字符串str 中出现的次数。)。例如:如果文件input. txt 中存放了下列数据: every 121 I am a student运行程序,并输入e后,输出: 2 0 1 int ff( char * str, char ch) int count =0; while ( (1) ) if( *str= =ch) count++; str ++; return count; # include < stdio. h > # include < stdlib. h > void main( ) char ch, c, s [80]; int k; FILE *fp; if( (2) ) printf( “打不开文件!n”); return; ch = getchar( ); k=0; while( ! feof(fp) ) c = fgete(fp); if (3) s[k++ ] =c; else s[k]= ; printf ( %dn ,ff(s, ch) ); k=0; (4) printf( % dn , ff( s, ch ) );
点击查看答案
相关试题
[说明] 编写一个字符界面的Java Applic...
[说明] 从键盘输入一个字符ch,输出该字...
[说明] 假设二叉树采用连接存储结构进行...
[说明] 设计一个计时程序。该程序用户界...
[说明] 计算下列源代码的McCabe环数,画...