¡GoConqr estrena diseño! Cuéntanos qué te parece.

Test

Java Week 2 Repetition

Troy Bowlin 17 preguntas

Hacer el test

Preguntas del test (17)

  1. 1Which of the following statements about the 'block' statement are true
    1. Ait groups a sequence of statements into a single statement
    2. Bit conditionally executes a sequence of statements
    3. Cit is used to prevent a sequence of statements from being executed
    4. Dit is used to contain a main statement
  2. 2What output will the following code produce
    int number;
    number = 1;
    while ( number < 6) {
    System.out.print(number);
    number += 1;
    }
    1. A12345
    2. B01234
    3. C123456
    4. D13579
  3. 3What is the following java code structure known as
    for ( i=0; i<10; i++) {
    for (j=0; j<10; j++) {
    //do something
    }
    }
    1. Anested loop
    2. Bdouble loop
    3. Cexponential loop
    4. Dnone of the above
  4. 4Which best describes the code below:
    while ( true ) {
    System.out.print("loop again)'
    }
    1. Ait is an infinite loop that will continue to loop forever (until the program is terminated)
    2. Bit is an interative loop that ends when the conditional expression is false
    3. Cit is not valid java code
    4. Dnone of the above
  5. 5What will be the output of the code below:
    int number;
    number = 1;
    while ( number < 6 ) {
    System.out.print (number);
    number = number + 1;
    }
    System.out.print("Done!");
    1. A1
      2
      3
      4
      5
      Done!
    2. B12345Done!
    3. C12345
    4. D12345
      Done!
  6. 6What will be the output of the code below:
    String x = stringFunction("mississippi");
    static String stringFunction(String str) {
    String test;
    int i;
    test = "";
    for (i = str.length() - 1; i >+ 0; i--) {
    test = test + str.charAt(i);
    }
    return (test);
    }
    1. Amississippi
    2. Bm i s s i s s i p p i
    3. Cippississim
    4. Dnull string
  7. 7An "animation" consists of a sequence of images shown rapidly one after the other on the computer screen.
    Each image i the animation is called a "frame".
    Suppose that you have a subroutine
    static void showFrame(int frameNum)
    that displays one frame in an animation
    That is, showFrame(1) display the first name showFrame(2) displays the second frame, and so on.
    Suppose that there are a total of thirty different frames.
    How many frames will the following code display?
    for ( in play = 0; play < 10; play ++) {
    for ( int i = 1; i < =30; i++)
    showFrame(i);
    }
    1. A30 frames repeated 10 times
    2. B310 frames
    3. C10 frames
    4. D30 frames
  8. 8A for loop can use a list structure such as an enum to iterate the for loop?
    1. AVerdadero
    2. BFalso
  9. 9The break loop when encountered will cause processing to skip to the beginning of the loop?
    1. AVerdadero
    2. BFalso
  10. 10The continue statement when used in a loop will cause the flow of process to skip to the end of the loop and begin another iteration of processing?
    1. AVerdadero
    2. BFalso

Información

Descripción
AS - Level (CS1102 Java) Computer Science Test sobre Java Week 2 Repetition, creado por Troy Bowlin el 02/10/2016.
Idioma
English
Visitas
0
Etiquetas
computer sciencecs1102 javaas - level
Valoración
Aún sin valoraciones
Valora este test
Valora este test

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?