Grade 12 Final Exam 2079: Visual Programming (C#) Practice Paper

1) What is the Common Language Runtime (CLR)?

  1. A compiler for C#
  2. An integratcd development environment
  3. A virtual machine for executing .NET code
  4. A database management system

2) Which of the following is the root of the hierarchy Of all .NET types?

  1. System.Base
  2. System.Object
  3. Systcm.Parent
  4. System.Root

3) What is the syntax for a for loop in C#?

  1. for (initializer; condition; iterator) {// code block}
  2. for (condition; initializer; iterator) {// code block}
  3. for (condition; iterator; initializer) {// code block}
  4. for (iterator; condition; initializer) {// code block}

4) How do you declare an array in C#?

  1. int array = new int[];
  2. int array = new array int[];
  3. int array = new int();
  4. int[] array = new int[];

5) Which of the following methods is used to convert a string to uppercase in C#?

  1. ToUpper()
  2. ToLower()
  3. Replace()
  4. Trim()

6) Which of the following is NOT a feature of a structure in C#?

  1. Can implement interfaces
  2. Cannot inherit from other structures or classes
  3. Can have properties and methods
  4. Can have a destructor

7) Which keyword is used to pass a pointer as a parameter by reference in C#?

  1. var
  2. ref
  3. out
  4. unsafe

8) Which namespace is used to connect to a database in C#?

  1. System.Data.SqlClient
  2. System.Data.OracIeCIient
  3. System.Data.OleDb
  4. All ofthe above

9) Which of the following statement is true for a Structure in C#?

  1. It can hold similar data types only
  2. It can hold dissimilar data type
  3. It can hold integer only
  4. All of above

“Group B”

Short Answer Questions [5*5 = 25]

10. Describe the .NET framework and it’s features.
11.
How do you declare a variable in C#? What are the different data types of variables in C#?
OR
Describe a namespace in How is it used in programming?
12.
Write a program to find the greatest number among three user input numbers in C#.
OR Explain Concat() and Trim() string functions with examples in C#.
13.
How do you use an array in CP? Explain with an example.
14.
What is a pointer in C#? Give an example of passing pointer as a parameter to methods.

“Group C”

Long Answer Questions [2*8 =16]

15. Differentiate between the while and for loop in C#. Explain with an example.
16.
Explain the database connection procedure in C# to develop the application with an example.
OR
Write a program to enter the details of three employees (ID and name) and display them using structure.