NEW
Font size
WorksheetsProgramming
Total questions: 45
Worksheet time: 45mins
Programmers make use of what type of program in order to translate higher-level language statements into machine code?
A compiler
A command prompt
An IDE
A JIT
A program's execution of various statements and procedures in a correct order to produce desired results is referred to as what defining characteristic?
The methods of the program
The program's GUI
The attributes utilized by the program
The program's logic
What is the process of removing all syntax and logical errors from a program in order to create a working program that accomplishes all intended tasks known as?
commenting out
debugging
executing
compiling
What is an object in relation to a defined class in a programming language?
It is a property of the class
It is an instance of the class
It defines the class state
It is an interface to the class.
What technique involves the packaging of an object's attributes and methods into a cohesive unit that can be used as an undivided entity?
Polymorphism
Inheritance
Interface
Encapsulation
What can be used to extend an existing class so as to create a more specific class?
Inheritance
Abstraction
Encapsulation
Polymorphism
What information must be supplied when utilizing a method that requires additional information in order to operate?
Primitive data
Arguments
Complex data
Literal strings
The use of "void" and "static" are both examples of what predefined C# language component?
attributes
objects
classes
keywords
What are nonexecuting statements that you can use to document or add notes to assist in the use of the program?
Whitespaces
Namespaces
Aliases
Program comments
What must be done once a C# program has been finished before it can be used?
It must be compiled into intermediate language.
It must be stripped of all comments before it can run.
It must be passed through a garbage collector to reduce unnecessary instructions.
It must be fed to a runtime interpreter.
What is NOT considered a keyword by the C# language?
global
implicit
static
catch
What is the term for a named location in computer memory that can hold different values at different points in time?
constant
alias
literal constant
variable
An assignment that is made when a variable is declared is known as what?
An allocation of the variable
An initialization of the variable
A definition of the variable
An assignment to the variable
What type of number can be described as having varying numbers of significant digits, which contains decimal positions?
integer
whole
floating-point
int
What type of arithmetic operator has one argument to the left and another argument to the right of the operator?
binary
unary
composite
complex
In C#, += adds the operand on the right to the operand on the left and assigns it to the operand on the left in one step. What is the name for this operator?
add and assign
prefix increment
increment and assign
postfix increment
How is a Boolean variable declared in a program?
A bool type variable must be declared, followed by the bool value.
A boolean type variable must be declared, followed by the bool value.
A char type variable must be declared, followed by the bool value.
An int type variable must be declared, followed by the bool value.
You are performing an arithmetic operation and have placed the desired result type in parentheses followed by a variable to be cast with the result. What is this an example of?
implicit casting
intrinsic casting
automatic casting
explicit casting
What type of program specifically allows and accepts user input?
static program
procedural program
interactive program
constant program
What method can be used to accept user input from the keyboard on the console?
Input()
Next()
NextLine()
ReadLine()
What method from the Convert class can be used to convert a specified value to an 8-bit unsigned integer?
ToByte()
ToDecimal()
ToSingle()
ToInt16()
What happens when "string1" is added to "string2" using the + sign in the C# programming language?
A type error occurs, and the program is halted.
The strings are converted to integer equivalents and then added together.
The strings are concatenated together.
The result is returned as a boolean integer.
What type of structure involves choosing between alternative courses of action based on some value within a program?
literal
sequence
fixed
decision
What type of statement can be used to make a single-alternative decision?
switch
fork
if
if-else
What should you use if you wish to execute two or more statements conditionally?
A switch statement.
A block enclosed within a pair of curly braces.
A defined sequence structure.
A declared decision structure.
What conditional operator can be used to create a compound Boolean expression as an alternative to if statements?
NOT
XOR
AND
OR
What character(s) do you use to make a conditional AND operator within a C# program?
||
|
&
&&
When using a switch structure to make decisions within a program, what keyword is used to begin the structure?
If
Break
case
switch
What keyword can you use to specify an action to take in the event that a test expression does not match any case?
switch
break
else
default
What character(s) serve as the NOT operator in the C# programming language?
<>
&&
&
!
What are the block of statements that are executed in a loop considered to be part of?
the loop block
an iteration block
a loop body
the loop header
What is any single execution of a loop referred to as?
A path through the loop.
A lap of the loop.
A round in the loop
An iteration of the loop
Many loop control variable values rely on an added value through each loop. What type of loop control variable is this?
A reducing loop control variable.
An expanding loop control variable
An incrementing loop control variable
A comparing loop control variable.
A loop for which the number of iterations is predetermined is known as what type of loop?
infinite
definite
indefinite
counted
A loop that is controlled by user input rather than altered by arithmetic is known as what type of loop?
definite
indefinite
infinite
sentinel
What type of loop allows you to indicate the starting value for the loop control variable, the test condition that controls loop entry, and the expression that alters the loop control variable, all in one convenient place?
do
while
for
repeat
What type of loop checks a Boolean expression at the "top" of the loop before the body has a chance to execute?
while
do
repeat
switch
What type of loop checks a Boolean expression at the "bottom" of the loop after each repetition has occurred?
do
for
switch
while
Both the while loop and for loops are considered to be in what category of loops?
posttest loops
pretest loops
for-test loops
intest loops
What type of loop is one in which the loop control variable is tested after the loop body executes?
fortest
pretest
posttest
intest
Totals that are summed one at a time in a loop are known as what type of totals?
accumulated
derived
incremented
decremented
What should an accumulator variable be set to before it is used to accumulate a total?
0
1
True
False
A value such as a 'Y' or 'N' that must be supplied in order to stop a loop is known as what type of value?
sentinel value
stop value
control value
switch value
You are writing a program that defines a variable within a loop, and then tries to use that variable outside the loop. However, the program does not run as intended. What is the issue?
The variable is being overwritten inside the loop.
The variable is limited to the scope of the loop.
The variable is declared with an incorrect type
The variable name conflicts with a built in keyword.
The program you are creating must output information onto the screen, and then position the cursor on the next line in preparation for additional output. What method should you use?
PrintLine()
Println()
Write()
WriteLine()
