白盒測試
題 13:根據(jù)下列流程圖編寫程序?qū)崿F(xiàn)相應(yīng)分析處理并顯示結(jié)果,并設(shè)計(jì)最少的測試數(shù)據(jù)進(jìn)行判定覆蓋測試。輸入數(shù)據(jù)打印出“輸入 x 值:”、“輸入 y 值:”。輸出文字“a=”和 a 的值;輸出文字“b=”和 b 的值。其中變量 x、y 均須為整型。

?文章來源地址http://www.zghlxwxcb.cn/news/detail-509802.html
import java.util.Scanner;
public class demo13{
public static void main(String[] args){
Scanner sc= new Scanner(System.in);
System.out.println("輸入x值");
int x = sc.nextInt();
System.out.println("輸入y值");
int y = sc.nextInt();
int a,b;
if(x>0||y>0){
a=10;
System.out.println("a="+a);
}else{
if(x<10||y<10){
b=0;
System.out.println("b="+b);
}else{
}
}
}
}
文章來源:http://www.zghlxwxcb.cn/news/detail-509802.html
到了這里,關(guān)于白盒測試題(13-16道題目+詳細(xì)代碼)的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!