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

Test

C# Programming Quiz

Mr Killer 9 preguntas Actualizado el 24 abr 2017

Hacer el test

Este test tiene tiempo límite, así que se abre en el reproductor de siempre.

Preguntas del test (9)

  1. 1What is wrong with the following code?

    uint number1 = -27;
    1. AUnsigned variables cannot hold negative numbers
    2. BThere is no such thing as a uint
    3. Cnumber1 variable ends with a number and this is invalid in C#
    4. DThere is nothing wrong with the code
  2. 2Is this valid C# code?

    enum Months {January, February, March, April, May, June, July, August, September, October, November, December};
    Months currentMonth = April;
    1. AVerdadero
    2. BFalso
  3. 3The // character is used to make a single line [blank_start]comment[blank_end] and the /* and */ is to start and end a multi line [blank_start]comment[blank_end].
    1. Acomment
    2. Bcomment
  4. 4The character used to move onto the next line in a Console.WriteLine command is an [blank_start]\n[blank_end]
    1. A\n
  5. 5What is wrong with the following code?

    int loopTerminator = 1;
    while(loopTerminator > 0)
    {
    loopTerminator = loopTerminator + 1;
    }
    1. AThe while loop will never meet it's stopping condition hence will go on forever
    2. BYou cannot assign a variable to it's self. The code should use loopTerminator++ instead;
    3. CThe code will not compile since there is no space between while and the brackets
    4. DThere is nothing wrong with the code
  6. 6What is the difference between an array and a list
    1. AArrays are a fixed size that must be declared upon it's creation, lists are no fixed size
    2. BLists are a fixed size that must be declared upon it's creation, arrays are no fixed size
    3. CYou must go through a list from top to bottom to find an element whereas an array can be accessed via a subscript such as array[2] for example
    4. DArrays are limited to storing int, bool and strings. They cannot store object classes whereas lists can
  7. 7Methods are useful in order for...
    1. AAvoiding having to write the same code more than once
    2. BCreating a more efficient program
    3. CAllowing the compiler to generate code for you automatically
    4. DMethods allow you to access variables that may not be accessible outside of the method
  8. 8What is a constructor?
    1. AIt is called when a class object is created and usually initialises all the starting variable values
    2. BIt is is a special type of method that can be called in your code
    3. CIt is a process that must be completed before an array can be used
    4. DIt is part of the compilation process where the compiler constructs the .exe file to launch the program
  9. 9What is the difference between Code A and Code B in terms of behaviour?

    Code A:
    int randomNumber = rand.Next(2);
    if (randomNumber == 0)
    {
    Console.WriteLine("Yo");
    }
    else if (randomNumber == 1)
    {
    Console.WriteLine("Hello");
    }

    Code B:
    int randomNumber = rand.Next(2)
    switch (randomNumber)
    {
    case 0:
    Console.WriteLine("Yo");
    break;
    case 1:
    Console.WriteLine("Hello");
    break;
    }
    1. ACode B will not compile because switch statements can't be used for integer variables
    2. BCode B will print Yo to the Console under different circumstances to Code A
    3. CThey both behave in exactly the same way
    4. DThere is a chance that Code B will print both Yo and Hello whereas this is not possible with Code A

Información

Descripción
GCSE Computer Studies Test sobre C# Programming Quiz, creado por Mr Killer el 24/03/2017.
Idioma
English
Visitas
0
Historial
Creado el 24 mar 2017 · actualizado el 24 abr 2017
Etiquetas
computer studiesgcse
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?