CS6004ES - Written - 7th May

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 17

EXAMINATION MAIN SIT QUESTION PAPER: Year 2022/23

Module code: CS6004ES

Module title: Application Development

Date: 7th May 2023

Day / evening: Day

Start time: 11.30 AM

2 hours
Duration:

Materials permitted: None


Warning: Candidates are warned that possession of unauthorised
materials in an examination is a serious assessment offence.

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.

Answer Question One and another one from Question Two


or Three from Section B.
Each question carries 20 marks
No credit will be given for attempting further questions.

DO NOT TURN PAGE OVER UNTIL INSTRUCTED

© London Metropolitan University


SECTION A – ANSWER ALL QUESTIONS
Answer all 30 MCQ questions. Each question carries two 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

Q-3) Which of the following is NOT a .NET Exception class?

1. Exception
2. StackMemoryException
3. DivideByZeroException
4. OutOfMemoryException

Q-4) What is the key objective of Integration testing?

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.It provides a consistent object-oriented programming environment whether object code is


stored and executed locally, executed locally but Internet-distributed, or executed remotely.
2.It provides a code-execution environment that minimizes software deployment and
versioning conflicts.
3.It provides a code-execution environment that promotes safe execution of code, including
code created by an unknown or semi-trusted third party.
4.It provides different programming models for Windows-based applications and Web-based
applications.
5.It provides an event driven programming model for building Windows Device Drivers.

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?

class HR h1, h2; // Here 'HR' is a user-defined class.


h1 = new HR(); h2
= new HR();
1. Contents of h1 and h2 will be exactly same.
2. The two objects will get created on the stack.
3. Contents of the two objects created will be exactly same.
4. The two objects will always be created in adjacent memory locations.

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;

private void DisplayData()


{
Console.WriteLine(i + " " + j);
}

public void ShowData()

Console.WriteLine(i + " " + 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

public void fun()

Console.WriteLine(" to Esoft!");

class MyProgram

static void Main (string[ ] args)


{

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

static void Main(string[] args)


{

int num = 1;

funcv(num);

Console.Write(num + ", ");

funcr(ref num);

Console.Write(num + ", ");

static void funcv(int num)

num = num + 10; Console.Write(num + ", ");

static void funcr (ref int num)

num = num + 10; Console.Write(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

Q-14) Difference between Response.Write() and Response.Output.Write().

1. Response.Output.Write() allows you to buffer output


2. Response.Output.Write() allows you to write formatted output
3. Response.Output.Write() allows you to flush output
4. Response.Output.Write() allows you to stream output
Q-15) Web.config file is used
1. Configures the time that the server-side codebehind module is called
2. To store the global information and variable definitions for the application
3. To configure the web server
4. To configure the web browser
Q-16) 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-17) Which of the following are valid step in SDLC framework?

1. Requirement Gathering
2. System Analysis
3. Software Design
4. All of the above

Q-18) Which one of the following is a functional requirement?

1. Maintainability
2. Portability
3. Business needs
4. Reliability

Q-19) Which one of the following is an ternary operator in Javascript?

1. ?
2. :
3. - 4. + Q-20) Which of the following is the correct statement of WHILE loop start?

1. while (i <= 10)


2. while (i <= 10; i++)
3. while i = 1 to 10
4. None of These

Q-21) Which of the following is the correct way to create a list using the lowercase letters?

1. <ol alpha = "a" >


2. <ol type = "a">
3. <ol letter = "a">
4. None of the above

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-25) Which of the following statements is correct about an Exception?

1. It occurs during compilation.


2. It occurs during linking.
3. It occurs at run-time.
4. It occurs during Just-In-Time compilation.

Q-26) Which of the following statements is correct about the C#.NET program given below?

using System; namespace


EsoftApp
{
class MyProgram
{
static void Main(string[] args)
{
int index = 6;
int val = 44; int[] a
= new int[5]; try
{
a[index] = val ;
}
catch(IndexOutOfRangeException e)
{
Console.Write("Index out of bounds ");
}
Console.Write("Remaining program");
}
}
}
1. Value 44 will get assigned to a[6].
2. It will output: Index out of bounds
3. It will output: Remaining program
4. It will output: Index out of bounds Remaining program

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?

using System; namespace


EsoftApp

{
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

Q-30) A____block enclose the code that could throw an exception.

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)

You might also like