Vbn70us Supp Exam

You might also like

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

VBN70US

VISUAL PROGRAMMING WITH VB.NET

DEGREE

YEAR 3

SUPPLEMENTARY FINAL EXAMINATION

MAY/JUNE 2021

Instructions to Candidates:

1. Time Allowed: 3 Hours.


2. Answer any Three (3) Questions in Section A.
3. Answer all Questions in Section B.
4. All questions carry 20 marks each.
5. Calculators are allowed provided they are not programmable.
6. No books, dictionaries, papers, cell phones or any other written materials are
allowed in this examination.
7. Candidates who break IUM examination regulations or commit any malpractice
will be disqualified from the examinations.

Total Marks: 100

Examiner: Mrs E. Nangolo


Section A (Answer any 3 questions)

Question 1

As part of the IUM rules a student should attend 80% of all classes. A student will not be
allowed to sit in exam if his/her attendance is less than 75%. Create a program in Visual
Basic, Take the following input from user:
- Number of classes held
- Number of classes attended.
And print
- percentage of class attended
- Is student is allowed to sit in exam or not.
[Total 20 Marks]

Question 2

Develop an application in Visual Basic to calculate the employees Gross Pay. The formula to
calculate the Gross Pay: GP = HW * HP
GP = Gross Pay
HW = Number of Hours Worked
HP = Hourly Pay Rate

The user interface must be as follow:

[Total 20 Marks]

1
Question 3

A school has following rules for grading system. Write a program in Visual Basic that
determines a student’s grade. Ask the user to enter marks and the program will read the score
and determine the grade based on the following rules:

Marks Grade

80 and above A
70 – 79 B
60 – 69 C
50 – 59 D
0 – 49 F

See the example output below:


If user enters a 80

Your grade is A. [Total 20 Marks]

Question 4

Professor Haimbondi wants to calculate the factorial numbers in his mathematic class. As an
IT student, you are the best candidate to help him solve his problem. With the aid of your
Visual basic expertise, write a program that will print the factorial of a number by defining a
method named 'Factorial'. You should name your program Factorial.
Factorial of any number n is represented by n! and is equal to 1*2*3*....*(n-1)*n. E.g.-
4! = 1*2*3*4 = 24
3! = 3*2*1 = 6
2! = 2*1 = 2
Also, 1! = 1, 0! = 0
[Total 20 Marks]

2
Section B (Answer all questions)

Question 1

Programming is the process of taking an algorithm and encoding it into a notation,


a programming language, so that it can be executed by a computer.
The Programming process consists of these 5 steps:-
Step 1. Identify the Problem
Step 2. Design a Solution
Step 3. Write the Program
Step 4. Check the Solution
Step 5. Testing the Program

Describe in detail what is involved at each step. (4 Marks each)

[Total 20 Marks]

Question 2

Object-oriented programming (OOP) is a programming paradigm based on the concept of


"objects", which can contain data and code: data in the form of fields (often known as
attributes or properties), and code, in the form of procedures (often known as methods).

Discuss the following principles of object Oriented Programming.


a) Inheritance
b) Encapsulation
c) Polymorphism
d) Abstraction
(5 Marks each)

[Total 20 Marks]

END OF QUESTION PAPER

You might also like