• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 三角形問題軟件測試用例設計之總結

    發表于:2009-09-27來源:作者:點擊數: 標簽:軟件測試設計三角形
    三角形問題軟件測試用例設計之總結 軟件測試用例設計 三角形設計測試用例的問題在 面試 的時候經常遇到。 假設輸入三個整數a、b、c分別作為三邊的邊長構成三角形。通過程序判定所構成的三角形的類型,當此三角形為一般三角形、等腰三角形及等邊三角形時!要

    三角形問題軟件測試用例設計之總結  軟件測試用例設計

    三角形設計測試用例的問題在面試的時候經常遇到。

      假設輸入三個整數a、b、c分別作為三邊的邊長構成三角形。通過程序判定所構成的三角形的類型,當此三角形為一般三角形、等腰三角形及等邊三角形時!要求畫出程序的流程圖和時序圖,并且用自己熟悉的一種語言實現這個功能!我在網上搜索了一下發現已經有好多文章,不過發現很少有寫出程序的,其實用java語言也可以實現,流程圖和程序圖參考的網上的。

      程序如下:

    package sanj;
    /**
     *
     * @author xingzunxi
     */
    import java.io.*;
    class sanj{
    public static int a,b,c;
     public static void main(String arg[]) throws IOException{
    try{
    BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in)); //接收鍵值
    System.out.println("輸入三邊值,每個值輸入后回車");
    System.out.println("請輸入:");
    a=Integer.valueOf(stdin.readLine());
    b=Integer.valueOf(stdin.readLine());
    c=Integer.valueOf(stdin.readLine());
    }catch(IOException e){
    System.out.println("出現異常!");
    System.exit(0);
    }
    if(a+b<c || a+c<b || b+c<a){
    System.out.println("你輸入的不能構成三角形");
    }
    if(a==b || a==c || b==c)
    {
    if(a==b && b==c) System.out.println("等邊三角形");
    else System.out.println("等腰三角形");
    }
    else System.out.println("一般三角形");
    }
    }

      【解】

      第一步:確定測試策略。在本例中,對被測程序的功能有明確的要求,即:

     ?。?)判斷能否組成三角形;

     ?。?)識別等邊三角形;

     

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>