Click to follow our Afritutor YouTube Channel, subscribe and click notifications and get updates on new learning videos


<=Back

<=KNEC Diploma in ICT module 2 Visual Programming past paper: July 2016

State the difference between conditional and unconditional loop as used in programming

    Viewed:  100  times
For Better experience and learning,for video answers, after video ends playing, click next question in the questions list!!!

  Share in:
        

Question Answer:





Questions List:

1. Outline four events associated with a Vscroll control in a visual basic programming language. (2 marks)
2. Explain the function of ADO Recordset Object as used in visual basic programming language. (2 marks)
3. Outline four functions available in the RptFunction control of a visual basic programming language. (4 marks)
4. Distinguish between unloadMe and Form1.Hide as used in a visual basic programming language. (4 marks)
5. Write a visual basic program that repeatedly accepts a non-zero numeric value from the user and store it in dynamic array named array1. The program should then display the values in a listbox and terminate when a user enters a zero value. Attach the code to a command button. Use do while loop. (8 marks)
6. Outline the function of each of the following elements of Integrated Development Environment (IDE) in visual basic program. (4 marks) (i) project form (ii) menu bar (iii) tool bar (iv) code window
7. Interpret the following visual basic program code. (5 marks) Public sub subfrmcntr With form1 . top = (screen.Hieght- .Hieght)/2 .left = (Screen. Width- .Width)/2 End with End sub
8. Write a visual basic program that allows a user to enter the string ‘Alex’ and 1234 into respective text boxes in a login screen. If the two are valid, a form named frmain is opened, otherwise a message ‘invalid name or password’ is display on a message box. Attach the code to a command button. (5 marks)
9. Asha created a visual basic program interface for her application . Explain three modes through which she could set the properties for the controls include in the interface. (6 marks)
10. Define each of the following terms as used in a visual basic programming language: (3 marks) (i) form module (ii) application (iii) project
11. Explain a challenge that companies with application built using visual basic 6.0 compiler may have with the changing software technology. (2 marks)
12. Outline four limitation of using visual basic programming languages. (4 marks)
13. List two databases object in visual basic other than ADO that may be used manipulate a database file. (4 marks)
14. Distinguish between method and a function as used in a visual basic programming language. (2 marks)
15. Write a visual basic program that displays the sequence of numbers 50, 45,40,35…0 on a listbox together with their cumulative sum, use while…wend loop. Attach the code to a command button. (5 marks)
16. A programmer was advised to decompose a large module into multiple procedures: Explain two reasons for this. (4 marks)
17. Write a visual basic program statement that could be used to perform each of the following; (i) display an image named bitmap.gif image control; (ii) Display the string “Hello Kenya…” on a label in a second form from the second form; (2 marks) (iii) position a shape at the centre horizontally on the screen. (2 marks)
18. In a visual basic program, an array named sales stores 10 decimal values. Write a statement that resizes the array to 50 elements while retaining the previous values. (2 marks)
19. Assume that a procedure has the following array declaration: Cost x As Integer= 30 Dim intpoints (x) As Integer Write a for…Next loop segment of the code that add each elements of the array into a listbox control. (2 marks)
20. An international; company dealing with beauty product pays a commission to the sales workers based on the criteria shown in table 1. Use it to answer the question that follows:Write a visual basic program that allows the user to enter the name of the sales agent and the sales volume made using text boxes. The program should then compute the commission and output the sales agent and the commission
21. Explain three types of code stepping feature used in a visual basic programming language. (6 marks)
22. With the aid of an example, explain the purpose of the library function in a visual basic program language. (6 marks)
23. Distinguish between Datafield and DataSource properties in visual basic
24. The future value (FV) of a property worth PV appreciating at the rate of R% per annum for a period of T years is given by the formula: FV=PV x (1+R/100)T Write a basic program that uses a function to calculate FV when a user enters a value of PV, R and T in text boxes. The program should then display the results in message box in a currency format. Attach the main procedure to a command button.
25. Explain each of the following section of a visual basic Data report; (i) report footer; (ii) Page footer
26. Outline the function of each of the following visual basic database tools; (4 marks) (i) Data environment; (ii) Data view; (iii) Data project (iv) visual data manager
27. Figure 1 show a visual basic program form designed to enter data using a ADO control to a database file having the fields named gender, English, Kiswahili and French. Use it to answer the questions that follows. Write a procedure attached to a command button that will achieve this. (Assume that all the properties associated with Adodc1 control have been set (7 marks)
28. A student created the following visual basic program to determine the roots of the quadratic equations. Use it to answer the question that follows. Private sub command1_click () Dim a, b, c, d, x1, x2 a= Val (Text1. Text) b= Val (Text1. Text) c= Val (Text1. Text) d= (b ^ 2 – 4 * a * c) x1= (-b + Sqrt(d)) / (2*a) x2= (-b - Sqrt(d)) / (2*a) Text4. Text = str(x1) Text5. Text = str(x2) End sub
29. Explain the function of each of the following properties as used in visual basic program screen design: (4 marks) (i) Anchor (ii) Dock
30. Outline four access rights to a user that can be set using cursor mode property of ADO data control. (4 marks)
31. (i) State the order of a precedence when solving the following expression in visual basic programming language; (2 marks) (A * B)/ C ^ D – E +F ^G
32. Distinguish between \ and mod operator as used in visual basic programming. (4 marks)
33. The body mass index (BMI) of a person is computed based on the body weight in kilograms and the body height in meters using the formula Weight/height^2 Write a visual basic program that allows the user to enter the weight and the height in text boxes. Using a function, the program should compute the BMI. The results should be displayed on a label formatted to 2 decimal places. Attach the code to
34. Tidy, a visual programming student had problem with a program she was writing. Explain one way that would show that her program had each of the following errors. (i) compilation (ii) run time
35. Distinguish between visual basic array statements declared in (i) and (ii). (4 marks) (i) public sub command_click () Dim Customer (200) As string (ii) Private sub command_Click() Option Base 1 DIM Customer(200) As string
36. State the difference between conditional and unconditional loop as used in programming
37. Write visual basic program that allows a user to enter 10 integer values into an array. The program should then sort the values using bubble sort technique and display the results in a picturebox. Attach a code to a command button. (8 marks)


About Us

Contact us

Terms of use | Privacy policy

Follow Us:               

All Rights Reserved © 2024; pscustudies.com