题目内容

Analyze the following statement:double sum = 0;for (double d = 0; d < 10;) {d += 0.1;sum += sum + d;}

A. The program has a compile error because the adjustment is missing in the for loop.
B. The program compiles and runs fine.
C. The program has a compile error because the control variable in the for loop cannot be of the double type.
D. The program runs in an infinite loop because d<10 would always be true.

查看答案
更多问题

Suppose the input for number is 9. What is the output from running the following program?import javA.util.Scanner;public class Test {public static void main(String[] args) {Scanner input = new Scanner(System.in);System.out.print("Enter an integer: ");int number = input.nextInt(); int i; boolean isPrime = true;for (i = 2; i < number && isPrime; i++) {if (number % i == 0) {isPrime = false;}} System.out.println("i is " + i); if (isPrime)System.out.println(number + " is prime");elseSystem.out.println(number + " is not prime"); }}

A. i is 3 followed by 9 is not prime
B. i is 4 followed by 9 is prime
C. i is 4 followed by 9 is not prime
D. i is 3 followed by 9 is prime

What is the printout after the following loop terminates?int number = 25;int i; boolean isPrime = true;for (i = 2; i < number; i++) {if (number % i == 0) {isPrime = false;break;}} System.out.println("i is " + i + " isPrime is " + isPrime);

A. i is 5 isPrime is false
B. i is 5 isPrime is true
C. i is 6 isPrime is false
D. i is 6 isPrime is true

可以对动画进行快慢、停顿、播放等带有交互性的操作,很多H5复杂炫酷的主视觉,就是借助了_____来实现的。

A. GIF图
B. 帧动画/序列帧动效
C. 视频类动效
D. 代码级动效

在H5,我们可以实现哪些动效?

A. GIF图
B. 帧动画/序列帧动效
C. 视频类动效
D. 代码级动效

答案查题题库