Programming for Games I - Pre Midterm Quiz Review

A detailed classroom scene featuring a computer screen displaying Unity and Visual Studio side by side, with C# code visible, surrounded by game design elements like characters and environments.

Programming for Games I - Pre Midterm Quiz

Prepare yourself for success in your Programming for Games I course with this comprehensive pre-midterm quiz review. Test your knowledge on Unity, C#, and game development fundamentals to ensure you're ready for the challenges ahead.

This quiz covers:

  • Game Programming Basics
  • Unity and Visual Studio Integration
  • C# Methods and Variables
  • Control Structures
60 Questions15 MinutesCreated by CodingDragon42
What type of relationship do Unity and Visual Studio share?
Symbiotic relationship
Isolated Relationship
The Scripting Reference supplies example code in regard to using a particular Unity component or feature. Where can you find more detailed (non-code-related) information about Unity components?
Reference Manual
Documentation
The Scripting Reference is a large document. How much of it do you have to memorize before attempting to write a script?
None, as it is a reference document, not a test
The fundamental parts, as we need to know essentials to be able to write a script
When is the best time to name a C# script?
Once writing the script has finished, and it is time to run the whole project.
When the new file appears in the Project tab with the filename in edit mode, which will make the class name the same as the filename and prevent naming conflicts
Doesn’t matter. Anytime is a good time to name a C# script.
What is the main purpose of a variable?
Assigning specific value to a defined variable
Storing a specific type of data for use elsewhere in a C# file
What role do methods play in scripts?
Methods store executable lines of code for fast and efficient reuse.
Methods store specific values for later use.
How does a script become a component?
By saving and playing the current scene
By changing the inspector specifications
By adopting MonoBehaviour as its parent class and attaching it to a GameObject
What’s the purpose of dot notation?
To access any existing scripts
To run existing methods
To access variables and methods of components or files attached to different GameObjects
To access variables
What is the proper way to write a variable name in C#?
Using PascalCase
Using camelCase
There is no restriction on variable names in C#
How do you make a variable appear in Unity’s Inspector window?
Declare the variable as public
Declare the variable as private
What are the four access modifiers available in C#?
When are explicit conversions needed between types?
When conversions take place automatically
When a smaller value will fit into another variable type without rounding
When an implicit conversion doesn’t already exist
Which of these requirements for defining a method?
The type of data returned from the method
The name of the method with parentheses
A pair of curly brackets for the code block
What is the purpose of the parentheses at the end of the method name?
To allow parameter data to be passed into the code block
To distinguish methods from classes
To define new variable
What does a return type of “void” mean in a method definition?
The method can return data, but not for the time being
There is data being returned by this method
The method will not return any data
How often is the Update () method called by Unity?
Every frame
On specified times
Once we execute the code
What is the most executed method in Unity?
Start ()
Update ()
Modify ()
What values are used to evaluate if statements?
0 or 1
True or false
Both: 0 or 1 & true or false
None
Which operator can turn a true condition false or a false condition true?
!
^
*
$
If two conditions need to be true for an if statement’s code to execute, what logical operator would you use to join the conditions?
**
||
&&
^^
If only one of two conditions need to be true for an if statement’s code, what logical operator would you use to join the two conditions?
||
$
&&
^^
What is the output of the following program?
Both values are not equal
Both values are equal
Syntax Error
Logical Error
Each case statement in switch statement ends with:
Semi-Colon
Dot
Comma
Colon
Switch statements can execute the same condition for multiple cases
True
False
If a case block is left empty or without a break keyword, it will fall through to the case directly beneath it.
True
False
If no initial values are assigned to an array when it is created, each element will be given a default value. Array storing number type default to ________ while other types set to _________.
0, 0
0, null
Null, 0
Null, null
We can add different types of datatypes in an Array like:
True
False (All datatypes must be the same)
The first index of an element in an array is always _______:
True
False
1
0
Once created, we cannot modify the List
True
False
What would be the output of the program?
Total students are: 4
Error
List does not support Count method
Total students are 5
In dictionary __________ acts as an index for its corresponding value
Value
Key
Key-value
Pair
Dictionaries are _______ unlike arrays and lists.
Unordered
Ordered
Sorted
In Dictionary, key and value are separated by _________.
Comma
Dot
Colon
Double quotation
In dictionaries, values must be unique, and they cannot be changed once initialized.
True (keys must be unique and they cannot be changed)
False (keys must be unique and they cannot be changed)
In Dictionary we cannot have a key value pair of different data types.
True
False
What would be the output of the Program?
2
1
0
4
What would be the output of the program?
0
2
4
Error
Methods can only be void in game development.
True (Methods can have any return type depends on the requirement of the program)
False (Methods can have any return type depends on the requirement of the program)
By default access modifier of the variable is internal.
True (Any variable that is not marked public is defaulted to private)
False (Any variable that is not marked public is defaulted to private)
Private method of one class can be extended in its child class
True (Private access modifiers have only access in the same class)
False (Private access modifiers have only access in the same class)
We can use keywords as variable names in C#.
True (We cannot use keywords as variable names)
False (We cannot use keywords as variable names)
Statements in a program execute in a random order.
True
False
While loop test the conditions after iterations.
True (while loop always test the conditions before iterations)
False (while loop always test the conditions before iterations)
Inner loop complete its iteration before outer loop.
True (Inner loop always completes its iterations before outer loop)
False
What is the output of the program?
Welcome to Arrays
Welcome to C# Programming
Welcome to C# Programming Welcome to C# Programming Welcome to C# Programming
Welcome to C# Programming Welcome to C# Programming Welcome to C# Programming Welcome to C# Programming
Foreach loop take each element in a collection and store it in a _________ variable, making it accessible inside the statement.
Local
Global
In statement
Statement
What would be the output of the program?
Both lines: Value is less than 5 and Value is 5 or greater than 5
Value is 5 or greater than 5
Infinite loop
Value is less then 5
For loops are best suited for arrays and lists, since they keep track of the current situation.
True
False
When we create a variable of a class type, we use _______ operator.
New
*
&
. operator
We cannot declare a class within another class in C# because this is against the rule of Object-Oriented Programming.
True
False
When we need to call a method or to access a field on an object, we use ________ operator.
Dot (.) operator
& operator
New operator
Constructor
Access modifiers like private, protected, public or internal restrict the access of class, methods, properties, or fields in C#. Access modifiers supports the OOP Principle called
Encapsulation
Polymorphism
Inheritance
Abstraction
__________ is a concept of bundling of data related methods, properties and variables in one class.
Encapsulation
Polymorphism
Inheritance
Abstraction
In __________, we first create general class then define specialized classes that have access to the members of the general class.
Inheritance
Encapsulation
Polymorphism
Abstraction
In above class header, class A is ________ class and B is ________ class.
Child, parent
Parent, child
Derived, base
Sub, super
In _______________, we use the same method name to indicate different implementations.
Polymorphism
Encapsulation
Inheritance
Abstraction
If no value assigned to variable, then they will be default numeric values to zero, null for string and false for bool.
True
False
When declaring a class in C#, there is no semicolon (;) to terminate class block.
True
False
Class body comprises class members including constructor, data fields, methods, etc.
True
False
Statements inside a class does not need to be terminated with a semicolon (;).
True
False
{"name":"Programming for Games I - Pre Midterm Quiz Review", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Prepare yourself for success in your Programming for Games I course with this comprehensive pre-midterm quiz review. Test your knowledge on Unity, C#, and game development fundamentals to ensure you're ready for the challenges ahead.This quiz covers:Game Programming BasicsUnity and Visual Studio IntegrationC# Methods and VariablesControl Structures","img":"https:/images/course1.png"}
Powered by: Quiz Maker