《软件测试技术及用例设计实训》源
更新时间:2024-05-09 09:32:01 阅读量: 综合文库 文档下载
P168
源程序:
#include
P171 源程序:
1. int testing(int x, int y) 2. {
3. int software=0; 4. if((x>0) && (y>0)) 5. {
6. software = x+y+10; 7. } 8. else 9. {
10. software = x+y-10; 11. } 12.
13. if(software < 0) 14. { 15. software = 0; 16. }
17. return software; 18. }
P173 源程序:
1 int Test(int i_count, int i_flag) 2 {
3 int i_temp = 1; 4 while (i_count>0) 5 {
6 if (0 == i_flag) 7 {
8 i_temp = i_count + 100; 9 break;
10 } 11 else 12 {
13 if (1 == i_flag) 14 {
15 i_temp = i_temp * 10; 16 } 17 else 18 {
19 i_temp = i_temp * 20; 20 } 21 }
22 i_count--; 23 }
24 return i_temp; 25 }
P174 源程序:
1 int _tmain(int argc, _TCHAR* argv[]) 2 { 3 int x,y; 4 scanf(\ 5 if(x > 0 && y > 0) 6 { 7 int i = 1; 8 if(x > y) 9 { 10 while((x * i)% y != 0) 11 i++; 12 printf(\13 } 14 else 15 { 16 while((y * i)% x != 0) 17 i++; 18 printf(\19 } 20 } 21 return 0; 22 }
P178 源程序:
int GetMaxDay( int year, int month ) {
int maxday = 0;
if ( month >= 1 && month <= 12 ) {
if ( month == 2 ) {
if ( year % 4 == 0 ) {
if ( year % 100 == 0 ) {
if ( year % 400 == 0 )
maxday = 29; else
maxday = 28; } else
maxday = 29;
} else
maxday = 28;
} else {
if ( month == 4 || month == 6 || month == 9 || month == 11 )
maxday = 30; else
maxday = 31;
} }
return maxday; }
P180
源程序:
Int IsLeap(int year) {
if (year % 4 == 0) {
if (year % 100 == 0) {
if ( year % 400 == 0) leap = 1;
}
else leap = 0; } else leap = 1; } else leap = 0; return leap;
P181 源程序: /*
作用:计算软件学院教师薪水
说明:节选自软件学院教师管理系统源代码 */
1 void CaculateTeacherSalary() 2 { 3 int i; 4 int j=0; 5 printf(\输入要计算的软件学院教师编号:\\n\6 fflush(stdin); 7 scanf(\8 for(i=0;i 16 printf(\输入月效益:\17 fflush(stdin); 18 scanf(\19 TeacherSalary[i]=(Teacher[i].TeacherBaseSalary+2*Teacher[i].TeacherMonthWorkDays+xiaoyi*Teacher[i].TeacherWorkYears/100)*0.5-baoxianjin; 20 printf(\号软件学院教师的薪水为:%lf元每月\\n\ 21 break; //找到该教师后,直接跳出循环 22 } 23 } 24 if(j==0) 25 26 } P182 printf(\未找到!\\n\ 源程序: /* 作用:输出软件学院教师信息 说明:节选自软件学院教师管理系统源代码 */ 1 void PrintTeacherInformation() 2 { 3 unsigned int i; 4 if(ActualNum!=0) 5 { 6 printf(\共有%d条软件学院教师信息\\n\7 printf(\8 for(i=0;i \\n\ 17 printf(\工龄:%d\\n\18 if(Teacher[i].TeacherSex==0) 19 printf(\性别:男\\n\20 else if(Teacher[i].TeacherSex==1) 21 22 23 24 25 26 27 28 29 30 31 32 33 printf(\性别:女\\n\else printf(\性别:无\\n\ printf(\基本工资:%f\\n\ printf(\月工作天数:%d\\n\switch(Teacher[i].TeacherEducation) { case 1: printf(\教育背景: 高中\\n\ break; case 2: printf(\教育背景: 学士\\n\ break; private MetroSaleTicket obj; protected void setUp() throws Exception { obj = new MetroSaleTicket(); //super.setUp(); } protected void tearDown() throws Exception { super.tearDown(); } //基本路径1 public void testOperation1() { String except = \ Assert.assertEquals(except,obj.operation(\} //基本路径2 public void testOperation2() { String except = \ \ Money: 2Yuan \\n\ \ \ Assert.assertEquals(except,obj.operation(\} //基本路径2 public void testOperation3() { String except = \ \ Money: 2Yuan \\n\ \ \ Assert.assertEquals(except,obj.operation(\} //基本路径4 public void testOperation4() { String except = \ Assert.assertEquals(except,obj.operation(\ } //基本路径5 public void testOperation5() { String except = \ \ Money: 4Yuan \\n\ } } \ \ Assert.assertEquals(except,obj.operation(\ //基本路径5 public void testOperation6() { String except = \ \ Money: 4Yuan \\n\ \ \ Assert.assertEquals(except,obj.operation(\} //基本路径7 public void testOperation7() { String except = \ Assert.assertEquals(except,obj.operation(\}
正在阅读:
《软件测试技术及用例设计实训》源05-09
网络布线系统设计11-21
喋血孤城观后感04-02
制药工程专业农药学A复习题05-08
2018年中考英语总复习第二部分语法专题(十四)连词和状语从句综合演练09-29
车间推进标准化建设实施细则06-23
- 多层物业服务方案
- (审判实务)习惯法与少数民族地区民间纠纷解决问题(孙 潋)
- 人教版新课标六年级下册语文全册教案
- 词语打卡
- photoshop实习报告
- 钢结构设计原理综合测试2
- 2014年期末练习题
- 高中数学中的逆向思维解题方法探讨
- 名师原创 全国通用2014-2015学年高二寒假作业 政治(一)Word版
- 北航《建筑结构检测鉴定与加固》在线作业三
- XX县卫生监督所工程建设项目可行性研究报告
- 小学四年级观察作文经典评语
- 浅谈110KV变电站电气一次设计-程泉焱(1)
- 安全员考试题库
- 国家电网公司变电运维管理规定(试行)
- 义务教育课程标准稿征求意见提纲
- 教学秘书面试技巧
- 钢结构工程施工组织设计
- 水利工程概论论文
- 09届九年级数学第四次模拟试卷
- 软件测试
- 设计
- 技术
- 监理规划及监理细则 - 图文
- 现代谈判学试题
- 八阶铁律
- 人力放线方案
- 2017医师定期考核人文医学考试题库
- 国内外粉末涂料助剂厂家
- 常熟理工学院 C语言题库(本三)
- 建筑施工企业定额的编制问题研究
- 成人自考高等数学历年考试试题与答案(2002~2012年)汇总
- 使用fork()调用计算Fibonacci数列
- 关于引深开展“手指口述”安全确认操作法实施方案的通知 - 图文
- 江苏省基本药物集中采购考核评价暂行办法
- 强制性个人账户养老金计发办法改革对替代率影响的实证研究
- 供配电输电线路
- 新视野大学英语第三版读写教程第四册翻译答案
- 北京及周边地区固体地球三维结构(正式-谢正观) - 图文
- 政策性银行信贷指引
- 标准反应吉布斯自由能的变化值
- K35+519.07滦柏干渠大桥创部优规划
- 冀教版五至二十二课八年级下册历史教案