Font size
WorksheetsFinal Exam
Total questions: 21
Worksheet time: 40mins
It helps you to repeatedly execute a block of code. The keywords with this statement are: do, for, foreach, and while.
Jump
Selection
Fixed
Iteration
What does a variable of type int hold?
Value of a decimal
An integer reference
Value of an integer
A pointer to an integer
A keyword used when you want to access members of a class. You do not have to create an object
Static Keyword
Void Keyword
Virtual Keyword
Datatype
Write a program in C# that will draw a square depending on the length entered by the user and if length is equal to 0, the system will end.
(See image beside for your reference)
A keyword that tells the compiler that there may be methods in the derived classes that will override the method in the main class.
Static Keyword
Void Keyword
Virtual Keyword
Datatype
What C# keyword allows a method to accept a variable number of method parameters?
var
params
par
varpar
ToString() method is a special method that returns a string that represents the current class.
TRUE
FALSE
A standardized (ECMA) language for creating .NET applications, services, and libraries, with a syntax similar to Java and C++.
C#
Javascript
Python
PHP
It is a user-defined structure that contains variables and methods.
String
Interface
Array
Class
It is a user-defined data structure that contains values of the same data type, such as marks as marks of students.
String
Delegate
Array
Class
It is used to end the current iteration of the loop and transfer the program control returns back to the beginning of the loop.
Break
Continue
Goto
Return
Write a program in C# that will accept 4 numbers randomly in an array and sort them in ascending order.
(See picture beside for reference)
In C#, there are six types of literals. Which among them are not type of literals?
Boolean
Integer
Data Type
Null
Declaration
It is used in the selection and loop constructs
Break
Continue
Goto
Return
Inheritance permits parent class to dynamically take behaviour of descendent class
TRUE
FALSE
What is a correct syntax to output "Hello World" in C#?
cout<<"Hello World";
System.out.println("Hello World");
Console.Writeline("Hello World");
print("Hello World");
To declare an array in C#, define the variable type with:
[]
<>
{}
()
How do you insert COMMENTS in C# code?
//This is a comment
/*This is a comment
#This is a comment
\This is a comment\
Which data type is used to create a variable that should store text?
char()
str()
var()
int()
Which operator can be used to compare two values?
=
<>
==
><
The nested for loop consists of multiple for statements.
TRUE
FALSE
