CS6004ES - Written - 7th May
CS6004ES - Written - 7th May
CS6004ES - Written - 7th May
2 hours
Duration:
Instructions to This exam is worth 40% of the assessment for the module.
candidates: Candidates MUST answer the SECTION A with 30 MCQ
questions (compulsory) Each question carries 2 marks.
Q-1) Which of the following is the root of the .NET type hierarchy?
1. System.Object
2. System.Type
3. System.Base
4. System.Parent
5. System.R
Q-2) Which of the following keyword, enables to modify the data and behavior of a base
class by replacing its member with a new derived member?
1) overloads
2) overrides
3) new
4) base
1. Exception
2. StackMemoryException
3. DivideByZeroException
4. OutOfMemoryException
1.Design Errors
2.Interface Errors
3.Procedure Errors
4.None of the mentioned
Q-5) Which protocol is used for requesting a web page in ASP.NET from the Web Server?
1.HTTP
2.TCP
3.SMTP
4.None of the above.
Q-6) Which of the following are NOT true about .NET Framework?
1. 1, 2
2. 2, 4
3. 4, 5
4. 1, 2, 4
Q-7) Which of the following statements is correct about the C#.NET code snippet given
below?
Q-8) Which of the following statements is correct about the C#.NET code snippet given
below?
class A
{
private int i;
public Single j;
}
1. j cannot be declared as public.
2. DisplayData() cannot be declared as private.
3. DisplayData() cannot access j.
4. There is no error in this class.
Q-9) If class 'A' has a Length property with get and set accessors then which of the following
statements will work correctly?
1 A.Length = 20; 2
A m = new A();
m.Length = 10;
3 Console.WriteLine(A.Length);
4 A m = new A();
int len; len =
m.Length; 5 A m
= new A();
m.Length = m.Length + 20;
1. 1, 3
2. 2, 4, 5
3. 4 only
4. 3, 5
Q-10) Which statement will you add in the function fun() of class B, if it is to produce the
output "Welcome to Esoft!"? namespace EsoftApplication
class A
{
public void fun()
Console.Write("Welcome");
class B: A
Console.WriteLine(" to Esoft!");
class MyProgram
B b = new B();
b.fun();
1. base.fun();
2. A::fun();
3. fun();
4. mybase.fun();
Q-11) Which of the following will be the correct output for the C#.NET program given
below?
namespace EsoftApp
class SampleProgram
int num = 1;
funcv(num);
funcr(ref num);
}
}
1. 1, 1, 1, 1,
2. 11, 1, 11, 11,
3. 11, 11, 11, 11,
4. 11, 11, 21, 11,
Q-12) Attribute must be set on a validator control for the validation to work
1. ControlToValidate
2. ControlToBind
3. ValidateControl
4. Validate
Q-13) What class does the ASP.NET Web Form class inherit from by default?
1. System.Web.UI.Page
2. System.Web.UI.Form
3. System.Web.GUI.Page
4. System.Web.Form
1. Requirement Gathering
2. System Analysis
3. Software Design
4. All of the above
1. Maintainability
2. Portability
3. Business needs
4. Reliability
1. ?
2. :
3. - 4. + Q-20) Which of the following is the correct statement of WHILE loop start?
Q-21) Which of the following is the correct way to create a list using the lowercase letters?
Q-22) The CSS property used to set the distance between the borders of the adjacent cells in
the table is -
1. border-collapse
2. border-radius
3. border-spacing
4. None of the above
Q-23) Which of the following CSS property is used to add stroke to the text?
1. text-stroke property
2. text-transform property
3. text-decoration property
4. None of the above
Q-24) Which of the following is NOT a .NET Exception class?
1. Exception
2. StackMemoryException
3. DivideByZeroException
4. OutOfMemoryException
Q-26) Which of the following statements is correct about the C#.NET program given below?
Q-27) Which of the following statements are correct about exception handling in C#.NET?
1.If an exception occurs then the program terminates abruptly without getting any chance to
recover from the exception.
2.No matter whether an exception occurs or not, the statements in the finally clause (if
present) will get executed.
3.A program can contain multiple finally clauses.
4.A finally clause is written outside the try block.
5.finally clause is used to perform cleanup operations like closing the network/database
connections.
1. 1 only
2. 2 only
3. 2 and 5 only
4. 3 and 4 only
Q-28) Which of the following statements are correct about exception handling in C#.NET?
1.If our program does not catch an exception then the .NET CLR catches it.
2.It is possible to create user-defined exceptions.
3.All types of exceptions can be caught using the Exception class.
4.CLRExceptions is the base class for all exception classes.
5.For every try block there must be a corresponding finally block.
1. 1 and 2 only
2. 1, 2 and 3 only
3. 4 and 5 only
4. All of the above
Q-29) Which of the following statements is correct about the C#.NET program given below
if a value "6" is input to it?
{
class MyProgram
{
static void Main(string[] args)
{
int index;
int val = 44; int[] a
= new int[5]; try
{
Console.Write("Enter a number:");
index = Convert.Tolnt32(Console.ReadLine());
a[index] = val;
}
catch(FormatException e)
{
Console.Write("Bad Format");
}
catch(IndexOutOfRangeException e)
{
Console.Write("Index out of bounds");
}
Console.Write("Remaining program");
}
}
}
1. It will output: Index out of bounds Remaining program
2. It will output: Bad Format Remaining program
3. It will output: Bad Format
4. It will output: Remaining program
1. Try
2. Catch
3. Exception
4. Error
Part 2 (Essay type questions)
Answer Question One and another from Question two or three. Each
question carries 20 marks
Q-1
1. Explain what encapsulation is? (4 Marks)
2. What are the advantages when using encapsulation? (4 Marks)
3. What are the different types of inheritance supported by C# ? (4 Marks)
4. What is the difference between Inheritance and Abstraction? (8 Marks)
Q-2
1. Explain .net Framework with diagram. (4 Marks)
2. What is the use of a virtual machine in visual studio (4 Marks)
3. What is a web application framework, and what are it’s benefits? (4 Marks)
4. Write a C# program to demonstrate Queue data structure. (8 Marks)
Q-3
1. Explain the following testing strategies. (5 Marks)
a. Integration Testing
b. Smoke Testing
2. Explain different phases of Software Development Life Cycle. (5 Marks)
3. Write necessary HTML and JavaScript code to create following output (10 Marks)