Saturday, 6 August 2016

July, 2011 M4.1-R4: APPLICATION OF .NET TECHNOLOGY

July, 2011
M4.1-R4: APPLICATION OF .NET TECHNOLOGY

NOTE:
1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and
PART TWO contains FIVE questions.
2. PART ONE is to be answered in the TEAR-OFF ANSWER SHEET only, attached to the
question paper, as per the instructions contained therein. PART ONE is NOT to be answered in
the answer book.
3. Maximum time allotted for PART ONE is ONE HOUR. Answer book for PART TWO will be
supplied at the table when the answer sheet for PART ONE is returned. However, candidates,
who complete PART ONE earlier than one hour, can collect the answer book for PART TWO
immediately after handing over the answer sheet for PART ONE.

TOTAL TIME: 3 HOURS TOTAL MARKS: 100
(PART ONE – 40; PART TWO – 60)

PART ONE
(Answer all the questions)

1. Each question below gives a multiple choice of answers. Choose the most appropriate one and enter in the “tear-off” answer sheet attached to the question paper, following instructions therein. (1x10)

1.1. What are the 4 pillars of any object oriented programming language?
A) Abstraction, Inheritance, Encapsulation, Constructor
B) Abstraction, Inheritance, Encapsulation, Polymorphism
C) Abstraction, Object of a class, Inheritance, Polymorphism
D) Abstraction, Constructor, Encapsulation, Polymorphism

1.2. Is the following code legal?
class ChildClass : ParentClassA, ParentClassB
{
}
A) Yes, a child class can have 2 base classes at the same time and it does also allow multiple
interface inheritance.
B) No, you cannot specify 2 base classes at the same time. You can specify only one base class to
inherit from. However, it does allow multiple interface inheritance.
C) Yes, C# supports multiple class inheritance and it does not allow multiple interface inheritance.
D) No, you can specify only one base class at the same time to inherit from. However, it does not
allow multiple interface inheritance.



1.3. In C#, Constructor is a class method that is executed when an object of a class is created.
A) Yes, usually used to initialize the data members of the new object.
B) No, usually not used to initialize the data members of the new object.
C) Yes, usually not used to initialize the data members of the new object.
D) None of the above

1.4. In C# do structures (struct) support inheritance?
A) No, structs do not support inheritance, but they can implement interfaces
B) Yes, structs do support inheritance, but they can implement interfaces
C) No, structs do not support inheritance, but they can’t implement interfaces
D) None of the above

1.5. What will be the output of the following code?
using System;
public class BaseClass
{
public BaseClass()
{
Console.WriteLine("I am a base class");
}
}
public class ChildClass : BaseClass
{
public ChildClass()
{
Console.WriteLine("I am a child class");
}
static void Main()
{
ChildClass CC = new ChildClass();
}
}
A) “I am a base class”
B) “I am a child class”
C) “I am a base class” and “I am a child class”
D) None of the above

1.6. What are the advantages of properties in C#?
i) Properties can validate data before allowing a change.
ii) Properties can transparently expose data on a class where that data is actually retrieved
from some other source such as a database.
iii) Properties can take an action when data is changed, such as raising an event or changing
the value of other fields.
A) ii)
B) i) and ii)
C) i) and iii)
D) i), ii) and iii)

1.7. Which of the following sentences given below correctly represent the nature of constants in C#:
i) Value of a constant in C# is unchangeable, which is to be known at compile time and do not
change during the execution of the program at run time.
ii) Constant is declared using the const keyword and must be initialized as they are declared.
iii) You can assign a value to a constant after it is declared and can be changed during the
execution of the program at run time.
A) ii)
B) i) and ii)
C) ii) and iii)
D) i), ii) and iii)

1.8. Which of the sentences given below correctly describe the nature of abstract methods:
i) Abstract methods are methods with only the declaration of the method with no
implementation.
ii) Abstract methods are methods with only the declaration of the method with implementation.
iii) Abstract methods cannot have body. The abstract class can override the virtual method with
an abstract method.
iv) If a class has a single abstract member, the class has to be marked abstract.
A) i)
B) i) and iii)
C) ii) and iii)
D) i), iii) and iv)

1.9. In ADO.NET which of the following statements do you agree with
i) When you need to populate your bound controls, use the DataAdapter’s Fill method on the
DataSet the controls are bound to. The DataAdapter will open and close connections as
needed.
ii) When you need to update the database, use the Update method of the DataAdapter.
iii) When the user closes the program, there is no need to worry about closing database
connections because they remain closed until needed.
A) i)
B) i) and iii)
C) ii) and iii)
D) i), ii) and iii)

1.10 Which of the sentences given below correctly describe the nature of the comments in C#:
i) Single Line Comments. You define single line comments with // as shown below.
//This is an example for single line comment
ii) Multi line comments. You define multi line comments with /* */ as shown below.
/*This is an example for
Multi Line comments*/
iii) XML Comments. You define XML comments with /// as shown below.
///This is an example for defining XML comments.
A) i) is correct
B) i) and iii) are correct
C) ii) and iii) are correct
D) i), ii) and iii) are correct

2. Each statement below is either TRUE or FALSE. Choose the most appropriate one and ENTER in the “tear-off” sheet attached to the question paper, following instructions therein. (1x10)

2.1 In C#, Value type is a user defined data type by using the struct keyword.
2.2 In C#, Boxing - Converting a value type to reference type is called boxing. An example is shown
below.
int i = 101;
object obj = (object)i; // Boxing
2.3 String objects are changeable.
2.4 We use a SqlConnection object to connect to a Microsoft SQL Server Database. SQL database
connections use the SqlDataAdapter object to perform commands and return data.
2.5 A partial class is a class whose definition is present in two or more file.
2.6 ADO is a class set providing access to relational data. It provides transparency using a common
interface to access various data sources using a core set of objects such as Connection,
Command and Recordset.
2.7 The SqlClient set of classes does not use OLEDB
2.8 We cannot acquire multiple pages in a single ASP.Net page by using FrameSet.
2.9 We can have unlimited number of cookies per website
2.10 In C# and .Net, the default size of Integer data type is 32 bits.

3. Match words and phrases in column X with the closest related meaning/word(s)/phrase(s) in column Y. Enter your selection in the “tear-off” answer sheet attached to the question paper, following instructions therein. (1x10)

                                          X                                                       Y

3.1 Default access modifier for a method                   A. Cookies.Discard()
3.2 If a is null, returns b, otherwise returns a             B. Private
3.3 To kill the cookies in a page                                 C. a ?? b
3.4 Explicitly kill a user’s session                             D. Modular
3.5 XML consumer client                                          E. Capacity
3.6 XML Schema definition tool                               F. Logical Operator
3.7 “System.data.dll”                                                 G. “csc.exe”
3.8 Operator “||”                                                        H. Assembly
3.9 System.Data.OleDb and System.                        I. .ashx file
Data.Common
3.10 Structural programming approach                    J. Session.Abandon()
                                                                                 K. System Namespace
                                                                                 L. a ? b
                                                                                 M. “xsd.exe”

4. Each statement below has a blank space to fit one of the word(s) or phrase(s) in the list below. Enter your choice in the “tear-off” answer sheet attached to the question paper,following instructions therein. (1x10)

A. reference                               B. System.object                                        C. 25-30
D. individual                              E. Control                                                  F. eq
G. value                                     H. .Net Runtime                                         I. memory
J. “named space”                       K. binary                                                    L. inheritance
M. &&

4.1 Arrays are passed by ________.
4.2 ________ is a binary operator for filter expressions in ADO.NET environment.
4.3 Maximum size of a viewstate should not be more than around ________ % of the page size.
4.4 In ASP.Net fragment caching refers to the caching of ________ user controls within a web form.
4.5 ________ is the root class in .Net.
4.6 The binary operator ________ operates on Boolean operands only.
4.7 Garbage Collection (GC) in .Net is invoked by the ________ at regular intervals.
4.8 Structures (structs) cannot support ________.
4.9 The conditional, iteration, jump, and exception handling statements ________ a program's flow
of execution.
4.10 In .Net namespaces are used to provide a ________ in which your application resides.


PART TWO
(Answer any FOUR Questions)

5.
a) How can the ADO.Net data be viewed as XML in Internet Explorer?
b) How many in built objects are there in ASP.Net?
c) List all the steps in order, to access a database through ADO.NET?
(4+4+7)

6.
a) What data type the RangeValidaton control supports in ASP.Net? What is a Server Object in
ASP.Net?
b) What is the difference between a DataReader and a DataAdapter?
c) Analyze the following code. What will be its output? Give reason.
using system;
public class DoTest
{
public static void Main ( )
{
// declaring and initializing of variable k of the type integer
int k =13;
Test (k) ;
console.WriteLine ( “ The value of k is ” + k );
// printing the value of k
}
public static void Test ( int p)
{
p++;
}
}
(5+4+6)

7.
a) Give an example that shows how to execute a stored procedure in ADO.NET?
b) What is SqlCommand.CommandTimeout Property used for?
c) i) What are the methods that can ensure asynchronous execution of the Transact-SQL
statement or stored procedure?
ii) Explain what happens if connection pooling is enabled.
(5+4+6)

8.
a) Write a program to accepts two given integer number and determine the largest among them
using VB.Net programming syntax.
b) Explain differences between layers and tiers with respect to web technology and organization of
code of an enterprise level application.
(5+10)

9.
a) Write a program in C# syntax to generate and print prime numbers in a given range. Also print
the number of prime numbers within the given range.
b) Discuss the advantages and disadvantages of the layered architecture for an enterprise level
application in context of web based services.
(7+8)

Next Set