软件测试NextDay 三角形 佣金代码实现(qfnu)

合集下载

NextDate函数测试用例

NextDate函数测试用例

NextDate函数测试用例1.测试程序源代码#include\#includeuingnamepacetd;voidNe某tDate(intyear,intmonth,intday);voidmain(){intyear=0,month=0,day= 0;Ne某tDate(year,month,day);}voidNe某tDate(intyear,intmonth,intday){cout<>year;while(!(year>=1911&&ye ar<=2022)){cout<>year;}cout<>month;while(month>12||month<1){ }cout<>month;cout<>day;while(day>31||day<1){cout<>day;}inti=0;i=day-29;while(month==2&&i>0){cout<>day;}if(month==2&&day==29){month=3;day=1;}eleday++;} eleday++;//月底计算;witch(month){cae1:cae3:cae5:cae7:cae8:cae10:if(day==32){month++; day=1;cout<if(day==31){month++;day=1;cout<cout<break;cout<白盒测试1开始2输入年、月、日43日期是否合法?无效日期5闰年的2月29日或者非闰年的2月28日6明天为3月1日87大月的31号或者小月的30号下个月是否大于129下个月1号1011日期加11月1号12结束DD-路径情况1.由一个节点组成,内度=0情况2.由一个节点组成,外度=0情况3.由一个节点组成,内度>=2或外度>=2情况4.由一个节点组成,内度=1并且外度=1情况5.长度>=1的最大链情况2:节点6、节点9、节点10情况3:节点2、节点3、节点5、节点7、节点8情况4:节点4、节点11白盒测试对每条DD-路径测试用例用例说明输入正确的年、月、日输入错误的年、月、日输入错误的年、月、日输入错误的年、月、日输入闰年2月29日输入非闰年2月28日输入大月31日输入小月30日输入12月31日输入数据预期结果实际结果2022年6月15日2022年6月16日2022年6月16日2501年6月15日日期输入有误输入有误,重新输入2022年6月33日日期输入有误输入有误,重新输入2022年13月15日日期输入有误输入有误,重新输入2000年2月29日2000年3月1日2000年3月1日2001年2月28日2001年3月1日2001年3月31日2001年4月1日2001年4月30日2001年5月1日2004年12月31日2005年1月1日2001年3月1日2001年4月1日2001年5月1日2005年1月1日。

软件测试三角形类型判断程序实验报告

软件测试三角形类型判断程序实验报告

软件测试技术第一次
实验报告
一、实验题目
测试三角形类型判断程序
二、实验开发工具:
Eclipse、JUnit、Ant
三、编码实现三角形类型判断程序:
class Triangle{
private double a, b, c;
public Triangle ( double a, double b, double c ){ this.a = a;
this.b = b;
this.c = c;
}
/*
返回值为1表示是等边三角形
返回值为2表示是等腰三角形
返回值为3表示是其他种类三角形
返回值为-1表示不能构成三角形
*/
public int type (){
//to be added
}
四、设计测试用例
建立一个被JUnit测试的类
建立对应的JUnit Test类
不能构成三角形的测试用例
构成等边三角形的测试用
构成等腰三角形的测试用例
构成其他种类三角形的测试用例
三角形有一条边是非正数
四、编写ant脚本驱动测试用例。

软件测试代码

软件测试代码

1、体验ETDD(Easy TDD):在一个字符串中查找子串参数:str,源字符串sub,需查找的子串返回:如找到,返加子串的位置,否则返回-1**/int find(char*str,char*sub){char*i,*j,*m;int k,l,len_str=0,len_sub=0;i=str;if(str==0||sub==0){return-1;}while(*i!='\0'){len_str++;i++;}j=sub;while(*j!='\0'){len_sub++;j++;}if(len_str<len_sub){return-1;}if(len_str!=0&&len_sub==0){return-1;}i=str;j=sub;for(k=1;k<=len_str-len_sub+1;k++){m=i;for(l=1;l<=len_sub;l++){if(*m==*j){m++;j++;}else{break;}}if(*j=='\0'){return k;}i++;j=sub;}return-1;}2、体验ETDD(Easy TDD):在一个字符串中反向查找子串参数:str,源字符串sub,需查找的子串返回:如找到,返加子串的位置,否则返回-1*/第一种方法:int findr(char*str,char*sub){return-1;}int rfind(char*source,char*match){char*p;int n=0;p=source;/*让指针p指向最后一个位置*/for(;*p!='\0';p++){n++;}for(;n>0;n--){if(*p==*match){return(strlen(p)+1);}p--;}return-1;}第二种方法:int findr(char*str,char*sub){char*i,*j,*m,*n;int k,l,len_str=0,len_sub=0;i=str;if(str==0||sub==0){return-1;}while(*i!='\0'){len_str++;i++;}j=sub;while(*j!='\0'){len_sub++;j++;}if(len_str<len_sub){return-1;}if(len_str!=0&&len_sub==0){return-1;}i--;j--;for(k=len_str;k>=1;k--){m=i;n=j;for(l=len_sub;l>=1;l--){if(*m==*n){n--;}else{break;}}if(l<=0){return k-len_sub+1;}i--;}return-1;}3、体验ETDD(Easy TDD):取得字符串的左边部分参数:des,保存结果字符串size,用于保存结果字符串的缓冲区长度src,源字符串count,取得的字符数返回:返回结果字符串指针**/char*left(char*des,int size,char*src,int count){char*i,*j;char*q=des;int l,len_src=0,len_des=0;if(des==0||src==0){return des;}if(count>size){return des;}i=des;while(*i!='\0'){len_des++;}j=src;while(*j!='\0'){len_src++;j++;}if(len_des==0||len_src==0){return des;}if(size>len_des){return des;}if(count>len_src){return des;}j=src;for(l=0;l<count;l++){*q=*j;j++;q++;}*q='\0';return des;}4、体验ETDD(Easy TDD):取得字符串的右边部分参数:des,保存结果字符串size,用于保存结果字符串的缓冲区长度src,源字符串count,取得的字符数返回:返回结果字符串指针**/char*right(char*des,int size,char*src,int iCount){char*i,*j;int l,len_src=0,len_des=0; if(des==0||src==0){return des;}if(iCount>size){return des;}i=des;while(*i!='\0'){len_des++;i++;}j=src;while(*j!='\0'){len_src++;j++;}if(len_des==0||len_src==0) {return des;}if(size>len_des){return des;}if(iCount>len_src){return des;}j--;i--;//des=i;for(l=iCount;l>=1;l--){*i=*j;j--;i--;}des=i+1;*i='\0';return des;}5、体验可视编程:将字符全部转为小写参数:str,需转为小写的字符串返回:返回结果字符串指针**/char*lower(char*str){char*i;char*j=str;i=str;if(str==0){return0;}while(*i!='\0'){if(*i>='A'&&*i<='Z'){*str=*i+32;}i++;str++;}str=j;return str;}6、体验可视编程:将字符全部转为大写参数:str,需转为大写的字符串返回:返回结果字符串指针**/char*upper(char*str){char*i;char*j=str;i=str;if(str==0){return0;}while(*i!='\0'){if(*i>='a'&&*i<='z'){*str=*i-32;}i++;str++;}str=j;return str;}7、体验ETDD(Easy TDD):删除字符串左边的空格参数:str,源字符串返回:返回结果字符串指针**/第一种方法:char*triml(char*str){char*i;char*j=str;int l,len_str=0;if(str==0){return0;}i=str;while(*i!='\0'){len_str++;i++;}//i=str;for(l=0;l<len_str;l++){if(*j==''){j++;}else{break;}}str=j;return str;}第二种方法:char*triml(char*s){long lLen;register i,k;//输入为空则直接返回if(!s)return NULL;lLen=(long)strlen(s);for(i=0,k=0;i<lLen;i++){if(s[i]!=''&&s[i]!=9&&s[i]!=10&&s[i]!=13)s[k++]=s[i];}s[k]=0;return s;}8、体验ETDD(Easy TDD):删除字符串右边的空格参数:str,源字符串返回:返回结果字符串指针**/char*trimr(char*str){char*i;char*j=str;int l,len_str=0;if(str==0){return0;}i=str;while(*i!='\0'){len_str++;i++;}i--;for(l=0;l<len_str;l++){if(*i==''){i--;}else{break;}}*(i+1)='\0';return str;}。

证券期货业软件测试流程、模板、技术、方法、业务分类、缺陷管理

证券期货业软件测试流程、模板、技术、方法、业务分类、缺陷管理

附录A(规范性附录)测试流程A.1测试估计目标:估算测试的工作量,预分配测试资源及测试活动时间。

作业活动:a)根据项目整体日程规划及应用系统质量要求选择适当的测试级别(见4.4);b)分析业务需求,估计测试工作量;c)根据项目整体日程规划及测试工作量估计结果,制定项目测试里程碑、周期;d)对测试工作量估计书,项目测试里程碑、周期进行评审。

输入输出(见表A.1):表A.1输入输出-测试估计A.2测试计划目标:a)策划所有测试活动,便于后续监控与跟踪;b)在项目初期尽早确定测试策略。

作业活动:a)对业务需求进行进一步分析,拟定测试计划;b)对测试计划进行评审。

输入输出(见表A.2):表A.2输入输出-测试计划A.3.1测试需求分析目标:24a)以业务需求、系统需求规格说明书等所有与被测功能相关的资料为基础,以系统设计、缺陷修复方案等相关文档为参考,确定应测试的内容、测试方法,形成完整、准确、清晰的测试需求;b)测试需求100%覆盖业务需求及系统需求规格说明书。

作业活动:a)根据业务需求及系统需求规格说明书,进行测试需求分析;b)根据分析结果,进行测试需求整理;c)对测试需求进行评审;d)可根据实际需要进行裁剪,如无此活动,可直接进行测试用例设计。

输入输出(见表A.3):表A.3输入输出-测试需求分析A.3.2测试用例设计目标:a)依据测试需求或系统需求规格说明书,进行测试设计,要求明确测试数据需求,为测试执行做好准备;b)测试用例100%覆盖需求。

作业活动:a)有测试需求分析活动时,根据测试需求撰写测试用例;b)无测试需求分析活动时,根据系统需求规格说明书撰写测试用例;c)对测试用例进行评审。

输入输出(见表A.4):表A.4输入输出-测试用例设计A.3.3测试数据目标:为测试执行准备测试数据,便于测试执行快速、有效开展。

作业活动:a)依据测试需求及测试用例要求,准备测试数据;b)验证测试数据;c)可根据实际需要进行裁剪。

白盒测试基本路径法实训报告三角形

白盒测试基本路径法实训报告三角形

白盒测试基本路径法实训报告三角形本次实训我选择了使用白盒测试基本路径法对三角形程序进行测试。

1. 程序代码下面是被测试的三角形程序的代码:```#include <stdio.h>#include <stdlib.h>int triangle(int a, int b, int c){if (a <= 0 || b <= 0 || c <= 0) {return 0;}if (a + b <= c || b + c <= a || c + a <= b) {return 0;}if (a == b && b == c) {return 1;}if (a == b || b == c || c == a) {return 2;}}int main(){int a, b, c;printf("Please input the length of three sides: ");scanf("%d %d %d", &a, &b, &c);int t = triangle(a, b, c);if (t == 0) {printf("Not a triangle.");} else if (t == 1) {printf("Equilateral triangle.");} else if (t == 2) {printf("Isosceles triangle.");} else {printf("Scalene triangle.");}}```2. 基本路径设计为了得到程序的所有可能执行路径,我们首先需要构建其控制流程图。

下面是三角形程序的控制流程图:![三角形程序控制流程图](https://i.imgurXXX/srVwOPI.png) 我们可以通过该图来得到程序的基本路径:1. 1-2-3-142. 1-2-4-5-6-8-9-10-11-12-13-143. 1-2-4-5-6-7-8-9-10-11-12-13-143. 测试用例设计根据基本路径,我们需要设计测试用例来覆盖所有的基本路径。

佣金计算程序测试用例设计_12121200217-林浩

佣金计算程序测试用例设计_12121200217-林浩

黑盒测试方法案例设计及应用
1学时
1学时
2实验目的与要求
使学生能够充分掌握黑盒测试方法中边界值分析方法,能够利用边界值分析法及等价类划分法设计高效的测试用例,用于解决实际问题。

3实验环境
硬件:笔记本电脑
软件:word
参考资料:
4准备工作
教师以实例讲解边界值分析法的基础理论。

给定待解决的问题。

5实验内容
某程序实现佣金计算功能,编写测试用例以测试该程序的佣金计算是否准确,要求利用等价类划分法和边界值分析法使得所设计的测试用例尽可能高效。

业务说明:销售商每月至少售出一支完整的步枪(一支枪机、一支枪托、一根枪管可组成一支完整的步枪)。

销售商根据每月的销售额提取佣金。

相关数据如下表所示。

佣金计算:
6实验步骤
1.分析程序的业务要求。

2.确定程序的输入数据。

3.按照输入或输出数据确定等价类。

4.按照等价类划分法和边界值分析法设计思想选取合适的测试用例。

5.按照测试用例执行程序,并记录所发现的bug。

软件测试实验报告_使用Parasoft C++ Test软件进行静态测试

软件测试实验报告_使用Parasoft C++ Test软件进行静态测试

软件测试实验报告学号:学生姓名:班级:实验6 使用Parasoft C++ Test软件进行静态测试学号********** 姓名*** 班级***** 时间2************一.实验题目在三角形问题中,要求输入三角型的三个边长:A、B 和C。

当三边不可能构成三角形时提示错误,可构成三角形时计算三角形周长。

若是等腰三角形打印“等腰三角形”,若是等边三角形,则打印“等边三角形”。

使用Parasoft C++ Test软件对三角形问题进行静态测试(代码走查)。

二.实验内容1. 安装并运行Parasoft C++ Test软件,了解其基本特点和功能。

2. 编写代码完成题目的功能要求,已有代码最好转成C++(或测试同学的代码),包含类的定义和使用。

3. 使用C++ Test软件对程序源代码进行静态测试1,生成测试报表。

静态测试1报表:4. 针对静态测试结果,对源程序进行修改,修改完成后再次进行静态测试2,根据结果检查之前的问题解决情况。

静态测试2报表:5. 实验报告:贴出静态测试1的测试报表,逐条对测试结果进行解释和分析。

然后贴出修改后的静态测试2的测试报表。

主要涉及到的问题:1.“{”、“}”占据一行;2.if、while等关键字后有空格;3.“=”、“+”等双目操作符前后各有一个空格;修改后的代码:#include "stdio.h"void Judge(int A,int B,int C);void main(){int A = 0, B = 0, C = 0;scanf("%ld %ld %ld", &A, &B, &C);Judge(A, B, C);}void Judge(int A,int B,int C){//注意:该函数内不能有scanf()语句,否则会无法测试//if (scanf("%ld %ld %ld", &A, &B, &C) != EOF){if (((A + B) > C) && ((A + C) > B) && ((B + C) > A)){printf("Girth is : %d ,", A + B + C);if ((A == B) && (A == C)){printf("Equilateral_Triangle\n");}else if ((A == B) || (B == C) || (A == C)){printf("Isosceles_Triangle\n");}else{printf("General_Triangle\n");}}else{printf("No_Triangle\n");}}}。

软件测试NextDay 三角形 佣金代码实现(qfnu)

软件测试NextDay 三角形 佣金代码实现(qfnu)

NEXT DAY 代码实现package .qfnu.ch01;import java.util.Scanner;public class nextday{public static void main(String[] args){System.out.print("Enter year/month/day(空格间隔):");Scanner input=new Scanner(System.in);int year=input.nextInt();int month=input.nextInt();int day=input.nextInt();if(year<1812 || year>2012){System.out.print("请输入1812~2012范围内的年份!\n");}if(1>month || month>12){System.out.print("请输入1~12范围内的月份!\n");}if(1>day || day>31){System.out.print("请输入1~31范围内的日期!\n");}else{System.out.print("你输入的year is:"+year+" month is:"+month+" day is:"+day+"\n");int tomorrowday = day,tomorrowmonth=month,tomorrowyear=year;switch(month){case (1):case (3):case (5):case (7):case (8):case (10):if(day<31){tomorrowday=day+1;}else{tomorrowday=1;tomorrowmonth=month+1;}System.out.print("Tomorrow's date is:"+tomorrowyear+"/"+tomorrowmonth+"/"+tomorrowday);break;case 4:case 6:case 9:case 11:if(day<30){tomorrowday=day+1;}else if(day==30){tomorrowday=1;tomorrowmonth=month+1;}else if(day==31){System.out.print(month+"月没有31天!");break;}System.out.print("Tomorrow's date is:"+tomorrowyear+"/"+tomorrowmonth+"/"+tomorrowday);break;case 12:if(day<31){tomorrowday=day+1;}else if(day==31){tomorrowday=1;tomorrowmonth=1;tomorrowyear=year+1;}System.out.print("Tomorrow's dateis:"+tomorrowyear+"/"+tomorrowmonth+"/"+tomorrowday);break;case 2:if(day<28){tomorrowday=day+1;}else if(day==28){if((year%4==0 && year%100!=0) || year%400==0){tomorrowday=29;}else {tomorrowday=1;tomorrowmonth=3;}}else if(day==29){if((year%4==0 && year%100!=0) || year%400==0){tomorrowday=1;tomorrowmonth=3;}else{System.out.print(year+"是非闰年,2月份无29天!");break;}}else if(day==30 || day==31){System.out.print("2月份不含"+day+"天!\n");break;}System.out.print("Tomorrow's date is:"+tomorrowyear+"/"+tomorrowmonth+"/"+tomorrowday);}}}}三角形问题:package .qfnu.ch01;import java.util.Scanner;public class sanjiaoxing{public static void main(String[] args){System.out.print("请输入三角形的三条边的长度:");Scanner input=new Scanner(System.in);int a=input.nextInt();int b=input.nextInt();int c=input.nextInt();System.out.println("side a is:"+a+" side b is:"+b+" side c is:"+c);boolean istriangle=true;if((a+b)<=c || (a+c)<=b || (c+b)<=a || a<=1||a>=200 ||b<=1||b>=200||c<=1||c>=200){istriangle=false;}if(istriangle==false){System.out.print("Not a triangle(不是三角形)");}else{if(a==b && a==c && b==c){System.out.print("您输入的为等边三角形!");}else if(a==b || a==c || b==c){System.out.print("您输入的为等腰三角形!");}else if(a!=b && a!=c && b!=c){System.out.print("您输入的为一般三角形!");}}}}佣金问题:package .qfnu.ch01;import java.util.Scanner;public class yongjin{public static void main(String[] args){double lockprice=45;double stockprice=30;double barrelprice=25;double totallocks=0;double totalstocks=0;double totalbarrels=0;double commission;Scanner input=new Scanner(System.in);System.out.print("Input the locks,stocks and barrels(空格间隔输入):");int locks=input.nextInt();if(locks==-1){System.out.print("当月销售活动结束!\n");}if(locks!=-1){int stocks=input.nextInt();int barrels=input.nextInt();if(1>locks || locks>70){System.out.println("对不起,枪机数不能为负数且厂商限制一个月只能卖出少于70个!");}if(1>=stocks || locks>=80){System.out.println("对不起,枪托数不能为负数且厂商限制一个月只能卖出少于80个!");}if(1>=barrels || barrels>=90){System.out.println("对不起,枪管数不能为负数且厂商限制一个月只能卖出少于90个!");}totallocks=totallocks+locks;totalstocks=totalstocks+stocks;totalbarrels=totalbarrels+barrels;System.out.print("Locks sold:"+totallocks+"\nStocks sold:"+totalstocks+"\nbarrels sold:"+totalbarrels+"\n");}double locksales=lockprice*totallocks;double stocksales=stockprice*totalstocks;double barrelsales=barrelprice*totalbarrels;double sales=locksales+stocksales+barrelsales;System.out.print("total sales:"+sales);if(sales>1800){commission=0.10*1000;commission=commission+0.15*800;commission=commission+0.20*(sales-1800);}else if(sales>1000){commission=0.10*1000;commission=commission+0.15*(sales-1000);}else commission=0.10*sales;System.out.print("commission is $:"+commission);}}。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

NEXT DAY 代码实现package .qfnu.ch01;import java.util.Scanner;public class nextday{public static void main(String[] args){System.out.print("Enter year/month/day(空格间隔):");Scanner input=new Scanner(System.in);int year=input.nextInt();int month=input.nextInt();int day=input.nextInt();if(year<1812 || year>2012){System.out.print("请输入1812~2012范围内的年份!\n");}if(1>month || month>12){System.out.print("请输入1~12范围内的月份!\n");}if(1>day || day>31){System.out.print("请输入1~31范围内的日期!\n");}else{System.out.print("你输入的year is:"+year+" month is:"+month+" day is:"+day+"\n");int tomorrowday = day,tomorrowmonth=month,tomorrowyear=year;switch(month){case (1):case (3):case (5):case (7):case (8):case (10):if(day<31){tomorrowday=day+1;}else{tomorrowday=1;tomorrowmonth=month+1;}System.out.print("Tomorrow's date is:"+tomorrowyear+"/"+tomorrowmonth+"/"+tomorrowday);break;case 4:case 6:case 9:case 11:if(day<30){tomorrowday=day+1;}else if(day==30){tomorrowday=1;tomorrowmonth=month+1;}else if(day==31){System.out.print(month+"月没有31天!");break;}System.out.print("Tomorrow's date is:"+tomorrowyear+"/"+tomorrowmonth+"/"+tomorrowday);break;case 12:if(day<31){tomorrowday=day+1;}else if(day==31){tomorrowday=1;tomorrowmonth=1;tomorrowyear=year+1;}System.out.print("Tomorrow's dateis:"+tomorrowyear+"/"+tomorrowmonth+"/"+tomorrowday);break;case 2:if(day<28){tomorrowday=day+1;}else if(day==28){if((year%4==0 && year%100!=0) || year%400==0){tomorrowday=29;}else {tomorrowday=1;tomorrowmonth=3;}}else if(day==29){if((year%4==0 && year%100!=0) || year%400==0){tomorrowday=1;tomorrowmonth=3;}else{System.out.print(year+"是非闰年,2月份无29天!");break;}}else if(day==30 || day==31){System.out.print("2月份不含"+day+"天!\n");break;}System.out.print("Tomorrow's date is:"+tomorrowyear+"/"+tomorrowmonth+"/"+tomorrowday);}}}}三角形问题:package .qfnu.ch01;import java.util.Scanner;public class sanjiaoxing{public static void main(String[] args){System.out.print("请输入三角形的三条边的长度:");Scanner input=new Scanner(System.in);int a=input.nextInt();int b=input.nextInt();int c=input.nextInt();System.out.println("side a is:"+a+" side b is:"+b+" side c is:"+c);boolean istriangle=true;if((a+b)<=c || (a+c)<=b || (c+b)<=a || a<=1||a>=200 ||b<=1||b>=200||c<=1||c>=200){istriangle=false;}if(istriangle==false){System.out.print("Not a triangle(不是三角形)");}else{if(a==b && a==c && b==c){System.out.print("您输入的为等边三角形!");}else if(a==b || a==c || b==c){System.out.print("您输入的为等腰三角形!");}else if(a!=b && a!=c && b!=c){System.out.print("您输入的为一般三角形!");}}}}佣金问题:package .qfnu.ch01;import java.util.Scanner;public class yongjin{public static void main(String[] args){double lockprice=45;double stockprice=30;double barrelprice=25;double totallocks=0;double totalstocks=0;double totalbarrels=0;double commission;Scanner input=new Scanner(System.in);System.out.print("Input the locks,stocks and barrels(空格间隔输入):");int locks=input.nextInt();if(locks==-1){System.out.print("当月销售活动结束!\n");}if(locks!=-1){int stocks=input.nextInt();int barrels=input.nextInt();if(1>locks || locks>70){System.out.println("对不起,枪机数不能为负数且厂商限制一个月只能卖出少于70个!");}if(1>=stocks || locks>=80){System.out.println("对不起,枪托数不能为负数且厂商限制一个月只能卖出少于80个!");}if(1>=barrels || barrels>=90){System.out.println("对不起,枪管数不能为负数且厂商限制一个月只能卖出少于90个!");}totallocks=totallocks+locks;totalstocks=totalstocks+stocks;totalbarrels=totalbarrels+barrels;System.out.print("Locks sold:"+totallocks+"\nStocks sold:"+totalstocks+"\nbarrels sold:"+totalbarrels+"\n");}double locksales=lockprice*totallocks;double stocksales=stockprice*totalstocks;double barrelsales=barrelprice*totalbarrels;double sales=locksales+stocksales+barrelsales;System.out.print("total sales:"+sales);if(sales>1800){commission=0.10*1000;commission=commission+0.15*800;commission=commission+0.20*(sales-1800);}else if(sales>1000){commission=0.10*1000;commission=commission+0.15*(sales-1000);}else commission=0.10*sales;System.out.print("commission is $:"+commission);}}。

相关文档
最新文档