扫码购买正式版题库

  • 海量题库
  • 全真模拟
  • 专项训练
  • 预测试题
  • 押题密卷
  • 错题强化

阅读下列Java程序,回答下列问题。 [Java 程序] public int addAppTask(Activity activity, Intent intent, TaskDescription description, Bitmap thumbnail) { Point size = getSize1; //1 final int tw = thumbnail.getWidth1; final int th = thumbnail.getHeight1; if (tw != size.x || th != size.y){ //2,3Bitmap bm = Bitmap.createBitmap(size.x, size.y, thumbnail.getConfig1); //4 float scale; float dx = 0, dy = 0; if (tw * size.x > size.y * th){ //5 scale = (float) size.x / (float) th; //6 dx = (size.y - tw * scale) * 0.5f; } else { //7 scale = (float) size.y / (float) tw; dy = (size.x - th * scale) * 0.5f; } Matrix matrix = new Matrix1; matrix.setScale(scale, scale); matrix.postTranslate((int) (dx + 0.5f), 0); Canvas canvas = new Canvas(bm); canvas.drawBitmap(thumbnail, matrix, null); canvas.setBitmap(null); thumbnail = bm; } if (description == null) { //8 description = new TaskDescription1; //9 } } //102.1、请简述基本路径测试法的概念。(2分)2.2、请画出上述程序的控制流图,并计算其控制流图的环路复杂度V(G)。(8分)2.3、请给出问题2中控制流图的线性无关路径。(5分)

问答题
阅读下列Java程序,回答下列问题。   [Java 程序]    public int addAppTask(Activity activity, Intent intent,    TaskDescription description, Bitmap thumbnail) {    	Point size = getSize1;                          //1    	final int tw = thumbnail.getWidth1;    	final int th = thumbnail.getHeight1;    	if (tw != size.x || th != size.y){                 //2,3Bitmap bm = Bitmap.createBitmap(size.x, size.y, thumbnail.getConfig1); //4    	float scale;    	float dx = 0, dy = 0;    	if (tw * size.x > size.y * th){                //5    	scale = (float) size.x / (float) th;          //6    	dx = (size.y - tw * scale) * 0.5f;   	} else {                      	//7    	scale = (float) size.y / (float) tw;    	dy = (size.x - th * scale) * 0.5f;    	}    	Matrix matrix = new Matrix1;    	matrix.setScale(scale, scale);    	matrix.postTranslate((int) (dx + 0.5f), 0);    	Canvas canvas = new Canvas(bm);    	canvas.drawBitmap(thumbnail, matrix, null);     canvas.setBitmap(null);    	thumbnail = bm;    }    if (description == null)  {                    //8    	description = new TaskDescription1;              //9    }   }                                        //102.1、请简述基本路径测试法的概念。(2分)2.2、请画出上述程序的控制流图,并计算其控制流图的环路复杂度V(G)。(8分)2.3、请给出问题2中控制流图的线性无关路径。(5分)

最新更新

易过题库在线搜题

热门题库