THE CATHOLIC UNIVERSITY OF EASTERN AFRICA
A. M. E. C. E. A P.O. Box 62157
00200 Nairobi - KENYA
MAIN EXAMINATION Telephone: 891601-6
Ext 1022/23/25
JANUARY – APRIL 2022 Fax: 254-20-891084
FACULTY OF SCIENCE
DEPARTMENT OF COMPUTER SCIENCE
REGULAR PROGRAMME
CMT 307: NET PROGRAMMING
Date: APRIL 2022 Duration: 3 Hours
INSTRUCTIONS:
i). Answer Question ONE and any other TWO Questions.
ii). Q1g, 4a and 5b are practical questions and must be done on the PC.
iii). The project should be saved in a folder bearing appropriate student
registration number.
iv). Ensure you submit your folder to the examiner at the end of exam period.
v). Confirm your work before handing in your work to the examiner.
Q1. a) Compare and contrast .NET and J2EE architectures from the following
perspectives
i). Execution engines (2 marks)
ii). Tools support (2 marks)
b) Create a new ASP.NET project named with your registration number as the
name. Add a master page to the project named “master”. Add a style sheet
file named “q1.css” to the project and link to the master page.
REQUIRED:
i). Using CSS/HTML5 and ASP.NET. design the master page with the
CUEA/ACAD/EXAMINATIONS/DIRECTORATE OF EXAMINATIONS & TIMETABLING Page 1
ISO 9001:2015 Certified by the Kenya Bureau of Standards
following look and feel [5 marks]
ii). Create a Database name “KOOS” which contains a table named
“customer” with email address, full names, address, gender,
password as the table attributes. The email address must be defined
as the primary key (3 marks)
iii). Create a new web form known as “q1.aspx” which captures the above
information. The page should use the master page created above
(3 marks)
iv). Perform validations such if email address doesn’t have a . and @
symbols, an error message shall be displayed by the app (1 mark)
v). Perform validations such that password and confirm password values
are the same (1 mark)
vi). Perform validations such that a user is forced to input all the values on
the form before saving them on the database (2 marks)
CUEA/ACAD/EXAMINATIONS/DIRECTORATE OF EXAMINATIONS & TIMETABLING Page 2
ISO 9001:2015 Certified by the Kenya Bureau of Standards
vii). Write a C# code which saved he above information in table customer
created in Qb(ii)above. (4 marks)
c) When dealing with ADO.NET architecture, when is it most appropriate to use
a data reader rather than a dataset
(2 marks)
d) Why is the idea of master pages so important when designing web pages
using ASP.NET architecture?
(1 mark)
e) Explain the role played by the following Visual studio components
i). Solution explorer (1 mark)
ii). Project menu (1 mark)
e) When dealing with methods in C#, what role do arguments and parameters
play ( 2
marks)
Q2. a) Microsoft CLI mechanism uses THREE mechanisms to support multiple
programming languages. Discuss TWO of these mechanisms and how
each supports cross-language development (4 marks)
b) Discuss THREE scenarios which are more convenient for .NET
programmers to use datasets instead of using data readers (3 marks)
c) Discuss TWO key services provided by .NET framework class Library
(FCL) to programmers
(4 marks)
d) What is the work of the following in an ASP.NET project?
i). App_data (1 mark)
ii). ContentPlaceHolder (1 mark)
e) Discuss TWO ways you can insert a CSS file when working with ASP.NET
web pages ( 2 marks)
Q3. a) what benefits do .NET programmers gain by the framework adopting a
stage compilation approach? ( 4
CUEA/ACAD/EXAMINATIONS/DIRECTORATE OF EXAMINATIONS & TIMETABLING Page 3
ISO 9001:2015 Certified by the Kenya Bureau of Standards
marks)
b) Using examples of your own, discuss the two types of type casting
supported by C# programming language (3
marks)
c) Practical question ( 8 marks)
Q4. a) To the project created in Q1, add a new page known as “q4.aspx”. The
page shall contain user interface which shall capture email adress and
password.
The two values should be passed to a method named studentLogin()
which
Returns login status inform of a Boolean value.
If the email address and password match the credentials in the database,
the method will return a value of 1 and “Authentication Successful”
message displayed for the user. The user shall be directed to another
page known as “customerdashboard” which displays “ welcome, your
name “ as the name appears in the database.
Otherwise, the method will return a value of zero then display error
message “Authentication Failure” , clear the password and focus the
cursor on the password field
REQUIRED:
i). Design the above page (2 marks)
ii). Define and implement method studentlogin() (6 marks)
iii). Supply the calling block for the above method (3 marks)
b) Explain how compilation takes place for .NET applications (4 marks)
Q5. a) .NET framework data provider exposes a number of objects to developers.
Discuss TWO of those objects and the role each plays (4 marks)
CUEA/ACAD/EXAMINATIONS/DIRECTORATE OF EXAMINATIONS & TIMETABLING Page 4
ISO 9001:2015 Certified by the Kenya Bureau of Standards
b) When would it be most suitable to use for each loop in your programs?
developing your applications in C#? (1 mark)
c) Before the emergency of .NET framework, programmers were using a
number of programming languages whitch had a number of shortcomings.
Explain the shortcomings associated with the following
i). Visual Basic 6.0 programming language (1 mark)
ii). Java Programming Language (1 mark)
d) Add a new webpage known as “Q5” to the project created in Q1. The page
should use the master page that was created in Q1 as well. The page will
be used to display all student records in the table student created in Q1
using a DatagridView control.
REQUIRED:
i). Design the appropriate user interface ( 2
marks)
ii). Write appropriate C# code that fetches all records of students from
student table then display them on a DatagridView control
(6 marks)
*END*
CUEA/ACAD/EXAMINATIONS/DIRECTORATE OF EXAMINATIONS & TIMETABLING Page 5
ISO 9001:2015 Certified by the Kenya Bureau of Standards