TERTIARY AND VOCATIONAL EDUCATION COMMISSION
COMMON WRITTEN EXAMINATION – 2020/ 2021
All rights reserved.
Diploma in Information & Communication Technology
NVQ Level 05 –Semester I
Software Programming K72T001M04 Three Hours
Answer only 04 questions including Question 01
Question 01
1.) Write a program to check whether a number entered by user is a primary number or not.
(10 Marks)
2.) The following interface use to login into the management information system of ABC Institute.
Use following database table details to answer the questions.
Database Name:- ABC_MI_System
Table Name:- User
Table field names and data types
Field Name Data type
id int
first_name varchar(100)
last_name varchar(100)
Page 1 of 3
TERTIARY AND VOCATIONAL EDUCATION COMMISSION
COMMON WRITTEN EXAMINATION – 2020/ 2021
email varchar(150)
user_id varchar(50)
password varchar(15)
a.) Write a code segment for connecting application with the `User` table. (Marks 10)
b.) If correct username and password entered and click “Login” button, it should show a
message box of “Correct Login Credentials”. Write the code segment for this scenario
(for validate user login). (Marks 15)
c.) Write a code segment to clear the information displayed in the input fields when click
the CLEAR button. (Marks 05)
Question 02
1.) Define term “Variable” with three examples. (04 Marks)
2.) Contrast while and do-while iterative structures. (04 Marks)
3.) List three (03) Source code management tools? (06 Marks)
4.) Discuss two differences between Structured Oriented and Object Oriented programming.
(06 Marks)
Question 03
1.) Briefly explain how is an Array different from Linked List? (07 Marks)
2.) Discuss the importance of finally block in exception handling? (06 Marks)
3.) If throwing a DivideByZeroException from try block and have two Catch block, first one with
„DivideByZeroException‟ exception class and second one with Exception class, which will code
block(s) execute? Refer following code segment. (07 Marks)
try
{
throw new DivideByZeroException();
}
catch (DivideByZeroException ex1)
{
Console.WriteLine("In DivideByZeroException Catch Block");// in .Net
System.out.println("In DivideByZeroException Catch Block");// in Java
}
Page 2 of 3
TERTIARY AND VOCATIONAL EDUCATION COMMISSION
COMMON WRITTEN EXAMINATION – 2020/ 2021
catch (Exception ex)
{
Console.WriteLine("In Exception Catch Block");// in .Net
System.out.println("In Exception Catch Block");// in Java
}
finally
{
Console.WriteLine("Finally Block");// in .Net
System.out.println("Finally Block");// in Java
}
Question 04
1.) Write two key features of ADO.NET. (04 Marks)
2.) Write down the role of JDBC Driver Manager class? (06 Marks)
3.) List down two JDBC API components. (04 Marks)
4.) Explain the importance of event handler? (06 Marks)
Question 05
1.) Write a program that prompts the user to input an integer and then outputs the number with the
digits reversed.
For example: if the input is 12345, the output should be 54321. (10 Marks)
2.) Briefly explain following two methods with example. (10 Marks)
a. Method Overloading
b. Method Overriding
Question 06
1.) How many instances can be created for an abstract class? Explain your answer. (04 Marks)
2.) Which Object Oriented Programming (OOP) concept is used as a reuse mechanism? (04 Marks)
3.) What do you understand by the menu-driven interface? (06 Marks)
4.) Why we need Stream Classes? (06 Marks)
Page 3 of 3