Welcome to the Baseline Knowledge Check. This is a formative test, designed to help you check your existing knowledge of the C# programming language.
There is no minimum score to pass the test as the questions are here to check what you already know before you start the course.
You can spend as long as you wish on any particular question, but you must manage your time to complete all the questions.
During the test, you may skip questions and return to them later in the session. You can also review your answers to previous questions and change them at any point during the session. The following questions make use of a pseudocode. Here's an explanation of what each expression will do:
//Sets a variable called a to 1
a = 1
//Compares a with b to determine if they have the same value
IF a = b THEN
. . . //Conditional code on IF being true
END IF
//Compares a with b and also c with d. If either of the comparisons are true the conditional code will run
IF a=b OR c=d THEN
. . .
END IF
//Compares a with b and also c with d. If both of the comparisons are true the conditional code will run
IF a=b AND c=d THEN
. . .
END IF
//Compares a with b. If they have the same value "true" is output, if they do NOT have the same value "false" is output
IF a=b THEN
PRINTLINE("true")
ELSE
PRINTLINE("false")
END IF
//A function that can be called from elsewhere that returns the word Done" to the client code
FUNCTION SomeFunction()
. . .
RETURN "Done"
END FUNCTION
//Code that invokes a function called SomeFunction. Any returned value is ignored
CALL SomeFunction()
//Code that invokes a function called SomeFunction. Any returned value is placed in a variable called a
a = CALL SomeFunction()
//A function that can be called from elsewhere that takes a parameter it calls x, adds 1 to it and returns the changed value
FUNCTION SomeOtherFunction(x)
x = x + 1
RETURN x
END FUNCTION
//Invokes a function called someOtherFunction passing it the value in a as a parameter
a = 5
b = CALL SomeOtherFunction(a)
//Repeats the indented code until a = b. Will run the indented code at least once
LOOP
. . .
WHILE a = b
//Repeats the indented code until a = b. May run the indented code zero times if a is not equal to b
WHILE a = b
. . .
LOOP
//Declares an array called shapes that contains three words and outputs "triangle" on one line and "circle" on the next
shapes = ["circle", "triangle", "square"]
PRINTLINE(shapes[1])
PRINTLINE(shapes[0])
//Declares an array called shapes that contains three words and outputs "triangle" on one line and "circle" on the next
shapes = ["circle", "triangle", "square"]
PRINTLINE(shapes[1])
PRINTLINE(shapes[0])