主观

阅读以下说明,回答问题1~2,将解答填入对应的解答栏内。

[说明] 某程序的功能是输入三个正整数作为边长,判断三条边构成的三角形是否等边、等腰或是一般三角形。

通过该程序的算法用等价类设计测试用例,检查逻辑覆盖标准。

参考答案
您可能感兴趣的试题

阅读以下说明和Java 码,将应填入(n)处的字名写在的对应栏内。

[说明] 编写一个学生类Student,要求:

 (1) 学生类Student 属性有:

 id: long 型,代表学号

 name: String类对象,代表姓名

 age: int 型,代表年龄

 sex: boolen 型,代表性别(其中:true 表示男,false 表示女)

 phone: String 类对象,代表联系电话

 (2) 学生类Student 的方法有:

 Student (long i,String n,int a,boolean s,String p)

 :有参构造函数,形参表中的参数分别初始化学号、姓名、

 年龄、性别和联系电话。

 int getAge ():获取年龄作为方法的返回值。

 boolean getSex ():获取性别作为方法的返回值。

 String getPhone ():获取联系电话作为方法的返回值。

 public String to String ():以姓名:性别:学号:联系电话的形式作为方法的返

    import java. applet. Applet;

 import java. awt.* ;

 public class Student extends Applet {

 long id;

  String name, phone;

 int age;

 boolean sex;

     Student(long i, String n, int a, boolean s, String p)

   {

   id=i;

   name = n;

   age = a;

   sex= s;

   phone = p;

   {

   public void paint( Graphics g)

   {

   Student x= new Student (5000," xiaoliu" , 89, true, " 8989898" );

    (1);

    (2) 

     g. drawstring( x. getPhone( ), 140,140);

   }

     int getAge( )

      { return age; }

     boolean getsex ( )

      { return sex; }

     String getPhone( )

      { return phone; }

     String ToString( )

     {

       (3) 

   }

 }

¥

订单号:

遇到问题请联系在线客服

订单号:

遇到问题请联系在线客服