03 2018 档案
摘要:1. Draw the control flow graph for the printPrime() method. ans: 2.Consider test cases ti = (n = 3) and t2 = ( n = 5). Although these tour the same pr
阅读全文
摘要:Primes.java 1 package findPrimes; 2 3 public class Primes { 4 5 private final static int MAXPRIMES = 100; 6 7 private boolean isDvisible(int a, int b)
阅读全文
摘要:对于Junit和hamcrest的安装,使用了eclipse自动导入的Junit4包(因为实验要求Junit以及hamcrest版本正好和eclipse氧气中自动导入的包版本一样),具体步骤如下: 鼠标右键点击工程->点击Properties->Java Build Path->Libraries-
阅读全文
摘要:题目一:1.Fault: 循环条件没设置好,i > 0会导致循环无法进行到数组第一项,应该改成 i >= 0。2.数组x为空时,会抛出空指针错误,循环无法执行,也不会执行上面叙述的Fault。3.只要满足数组x[0]不是与y相等的唯一的元素即可避免Error,比如测试用例 x = [1, 2, 3,
阅读全文

浙公网安备 33010602011771号