You are on page 1of 1

SSM-II.

2020-2022 Batch MBA IIMU

Problems for Lab-III

1. Leap Year

Develop a VBA function that takes a four digited year- number as input, and returns TRUE or FALSE,
depending on whether the year is a leap year or not.
(you may have to use AND, OR, and MOD operators available in VBA for this)

2.
Refer to the problem “Check Digit Validation” (Problem No. 27 of Exercises-II, page no. 151) of your SS
Note. Develop a function for the problem described, and test it thoroughly. You need not follow the
template given; you can follow your own logic.
(You may have to use MOD operator, and VAL, MID, RIGHT, LEN functions of VBA for this)

3.
Given N, develop an array- function which outputs a square matrix with N rows and N columns, which
has 1 across the main diagonal and in all cells below the main diagonal, and zero everywhere else. That
is, if A is your matrix,

A(i,j) = 1 for j <=I, and I = 1,2,…,N


= 0 otherwise

4.
Extend the function GMATCH developed in your class, by
a.) incorporating a suitable error message if the lookup value does not exist in the given range.
b.) returning the first value encountered in the search, and not the last one. Execute this using 2
different methods–
(i) “FOR NEXT” Loops, you might have to use “EXIT FOR” statement
(ii) “DO UNTIL” or “Do WHILE” Loops, (you might have to use OR, AND operator
available in VBA) [prefer doing this without using “EXIT DO” statement]

You might also like