0% found this document useful (0 votes)
787 views6 pages

Ubteb Past Papers Introduction To Programming With Visual Basic Aug 2022

The document outlines an examination paper for the National Diploma in Information and Communication Technology, focusing on practical programming tasks using Visual Basic. Candidates are required to complete four out of six questions, which include designing user interfaces and writing code for various applications such as a scientific calculator, quadratic equation solver, loan payback calculator, multimedia player, prime number tester, and a traffic light simulator. Each question specifies design and coding requirements, along with instructions for saving and printing the work.

Uploaded by

ghillaryal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
787 views6 pages

Ubteb Past Papers Introduction To Programming With Visual Basic Aug 2022

The document outlines an examination paper for the National Diploma in Information and Communication Technology, focusing on practical programming tasks using Visual Basic. Candidates are required to complete four out of six questions, which include designing user interfaces and writing code for various applications such as a scientific calculator, quadratic equation solver, loan payback calculator, multimedia player, prime number tester, and a traffic light simulator. Each question specifies design and coding requirements, along with instructions for saving and printing the work.

Uploaded by

ghillaryal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 6
UGANDA BUSINESS AND TECHNICAL EXAMINATIONS BOARD PAPER CODE PROGRAMME | DATE TDIT 125 NATIONAL DIPLOMA IN INFORMATION | MONDAY, AND COMMUNICATION TECHNOLOGY 15™ AUGUST 2022 | YEAR I SEMESTER II SERIES PAPER NAME TIME ALLOWED JULY/AUGUST 2022 | INTRODUCTION TO PROGRAMMING WITH 3 HOURS VISUAL BASIC YOU SHOULD HAVE THE FOLLOWING FOR THIS EXAMINATION Computer with Visual Basic Software installed Compact Disc (CD) Printer and Printing papers INSTRUCTIONS TO CANDIDATES i © 2022 Uganda Business and Technical Examinations Board This paper consists of six practical questions. 2. Answer only four questions. 3. 4 All questions carry equal marks. }. Open a folder on the desktop with your name and registration number where all the practical work shall be saved. . Transfer all your files and projects to the compact disc (CD) and print the hard copies of outputs and codes. . Do not write anywhere on this question paper. Turn Over Question One while making Calculation, Calculators are very important In our daily life. They are helpful ve sin r example, any domain. Calculators vary based on their functionalities. Fo oe enti 1. However, in this cage ons that it cannot handle unlike a scientific calculator / has some functions that dh genigibi a standard calcutato, c lator, we will be dealing with a scientific calculator. On the calc ensured, Ai Lr ition ir radians. 1. Sinis the function that computes the value of the sine of an angle in i idians. 2. Cos is the function that computes the value of the cosine of an angle in ra‘ igh : in radians. 3. Tan is the function that computes the value of the tangent of an angle in radk 4. Log computes the value of the logarithm to base 10 whilst In computes the value of natura) logarithm. Figure 1: Calculator ce iu 2 + | Sar} Sin a 5 6 - M | Cos 2 8 x MR | Tan ec : =] =] me] tog Required: (@) Design the above calculator interface using the relevant Visual Basic controls. — (10 marks) (b) Write Visual Basic codes to visualize the button functionalities, (12 marks) (C) Print the interface design and the codes, (03 marks) NX Question Two Quadratic equation is a fairly straight forward high school mathematics Pr the equation has a: oblem. The quadratic ell as equation solver is programmed to determine the number of roots solve the problems. to compute the roots. It uses the determinant b? — dac to solve the p 5 on it has one root, else it has n If b? — 4ac > 0, then it has two roots and if b? ~ dae = 0, then it has 07 root. To obtain the roots, the program uses the standard quadratic formula Required: (a) Design a Visual Basic interface that will help a user input the coefficients of the equation to compute its roots and determine the number of roots. (10 marks) (b) Write a Visual Basic code to implement the computation of the roots of the equation. (12 marks) (c) Print the interface design and the codes of the project. (03 marks) Question Three Currently, people seem to face a lot of difficulties to secure a loan or have a problem to pay back the loan. Still, we need to borrow money every now and then to acquire an asset or to pay for education fees. So, naturally we need to find out how long we can settle a loan for 2 certain amount of monthly payment at a certain interest rate. It is not easy to calculate such figures, fortunately Visual Basic comes to the rescue. There is a built-in function in Visual Basic to calculate the payback period. It is known as Nper and the syntax is Nper (Rate, Pmt, Pv, Fv, Due) where; « Rate=Interest Rate * Pmt=Amount of Periodic Payment * PVv=Loan taken * Fv=Future Value (set to 0 if loan is settled) * Due=Set to 1 if payment at the beginning of the Period, set to 0 if payment at the end of x100% the period since payback = loan ‘monthly payment Turn Over vill be used to compute the payback o¢ Required: (a) Design a Visual Basic user interface design that W vot be ly payment o the UGx84000 given that the interest rate is 4% and monthly payme' 445, (10 marks 12 (b) Write the code to implement the above computation. (12 marks) 03 m (c) Print the interface and codes. (03 marks) Question Four media player that follows the steps describeq You are provided with a screenshot of a multi below; Step 1: User chooses the type of files he wants to play. Step 2: User selects the drive that might contain the rele ‘Step 3: User looks into directories and subdirectories for tht vant audio files. .e files specified in step 1. The files should be displayed in the FileListBox. Step 4: User selects the files from the FileListBox and clicks the Play button. Step 5: User clicks on the Stop button to stop playing and Exit button to end the application, Figure 2: Multimedia Player Bace EaProman Fee aires Vins Sto Required: (@) Redesign the user interface above using the relevant control tools and properties. (10 marks) () Write a Visual Basic code to implement the multimedia project designed in 4(a). (12 marks) (03 marks) (c) Print the interface design and the codes of the project. Question Five A program should test whether a number entered by the user is a prime number or not. A Prime number is a number that cannot be divided by other numbers other than by itself without having a remainder. Examples are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37 and more. For case 1, all numbers that are less than 2 are prime numbers. In case 2, if the number is 2, it is a Prime number. In the last case, if the number N is more than 2, we need to divide this number by all the numbers from 3, 4, 5, 6,.......Up to N-1. If it can be divided by any of these numbers, it is not a prime number, otherwise it is a prime number. Required: (a) _ Design a Visual Basic interface that will help a user input a number that will be checked whether it is a prime number or not a prime number. (10 marks) (b) — Write a Visual Basic code to implement the above process. (12 marks) (03 marks) (c) _ Print the interface design and the codes of the project. Question Six A traffic light simulator works like the actual traffic lights. It can be programmed fairly easily. In this program, you have to insert one timer and set its interval to any figure. Here, we set it to 3000, which is equivalent to 3 seconds. Next, you insert three shapes and set their shape properties to circle and fill them with three colors, green, amber (or yellow) and red. Required: (a) _ Design a Visual Basic interface using the required Visual Basic controls that will visualize the interface below. (10 marks) Figure 3: Traffic tight (b) Write a Visual Basic code to implement the above process. (12 marks) (©) Print the interface design and the codes of the project. (03 marks

You might also like