Question Bank for Visual Basic
1. 2. 3. 4.
What reasons reasons are are there there for for creatin creating g custom custom interf interface? ace? What is is an object object model model and and how do do they benefit benefit s/w development development?? What What is is univ univers ersal al data data acces access? s? What are are the two propert properties ies of the text text box that that are used used to bind it to to a record set set object? 5. Identify Identify the the 3 types of propert property y procedures procedures & state state when would would you use use them. 6. Identify Identify the the built built in events events for class modules modules & explain explain custom custom events. events. 7. Explain Explain the process process for using a class class module module in an applicat application. ion. 8. Explain Explain early early and late late binding binding & the effect effect of each on on the perform performance ance of an application. 9. Explai Explain n how to crea create te contr controls ols at at run time time.. 10. Discuss control collection collection in V.B. including its properties, properties, uses & how to create create it. 11. Explain how to create create a menu & menu item at run time?. 12. Explain Explain the concept of validation. validation. 13. What does the immediate window allow allow you to do while debugging? 14. How can setting the break when value is is true option for a watch help you to debug your code? 15. What are the 2 properties of the error object that can be useful useful in determining determining the cause at an error within an error handler? 16. What are stored procedures & how they benefit your your application? 17. What is a cursor ? What 2 locations can cursor exists? 18. Explain concept collection instead instead of array. 19. What is the difference difference between function call by value & call call by reference? 20. What is the the difference between class class module & standard module? 21. Explain Explain the followi following ng : i. Clipboard ii. C om iii. Control ar array iv. Dialog box v. Event driven vi. Event procedure vii. Event trapping viii viii.. Proc Proced edur uree call call with with argu argume ment nt ix. MDI & SDI x. Validation ru rule 2. 3. 4. 5. 6. 7. 8.
Expl Explai ain n any any 5 data data typ types es.. Explai Explain n the the conce concept pt of of mess message age box. Explain Explain the difference difference between between check box & option button. button. When When do we use use comb combo o box box & list list box? box? Explai Explain n any 3 format format date date & time time funct function ion.. Explain Explain the differ difference ence between between lost lost focus, focus, got focus focus & set set focus. focus. Explai Explain n the declara declaratio tion n state statemen ment. t.
9. Explain the concept of variable scope.
10. Explain the difference between : a. #Input & #Output. b. #Get & #Write. 11. How to decide when to use a random file mode & append mode? 12. How to create dynamic array of user defined data type? Explain with following example: Create Emp data type Eno Ename Esal. 13. Explain the collection property with syntax. 14. Explain the concept of initialize & terminate event at class. 15. Explain BOF, LOF & EOF. 16. Explain the concept of date bound. 17. Explain the 3 steps of debugging. 18. Write program to add new record, find record, display previous record & last record. 19. Explain any 3 print methods. 20. Explain the concept of Active-X Control. 21. How to use input box to randomly retrieve the records? 22. Explain the concept of record set. 23. What the use of nomatch property? 24. Explain the difference between find & seek. 25. Explain the concept of trapping database errors. 26. What is database field & vbfield? 27. What are dynasets & snapshots? 28. How to change enable & disable & caption property of a button at run time? 29. Explain the difference between static & constant. 30. Explain hoe to search data from list using do loop. 31. Explain all form events in sequence. 32. Write code for cut, copy & paste of selected text. 33. Explain any 5 string functions with syntax. 34. Explain any 5 mathematical functions with syntax. 35. Explain the prefix concept with suitable example. 36. Explain any 2 types of errors. 37. Write a program to display the no of years difference after entering the date of birth. 38. Explain the use of timer control. 39. write a program to add item, remove item & sort the list. Also search the data items from that. 40. Explain activate & deactivate event of form. 41. What is the difference between load & show form? 42. Explain the spc & tab function.
43. Create PMT function & call that in command button. Display all values in different text boxes. 44. What is general procedure & function procedure? 45. Write a program to calculate discount using option button & display grass total & net total. 25%
Gross Amt
20%
Net Amt
10%
Discount Amt
46. Write a program using 2 dimensional array student rollno. & 2 subject marks. Display: Rollno Sub1 Sub2 Total 47. Explain the graphic method. 48. Write a program using list box. Select the drawing object & draw the selected object in picture box. 49. Write a program to open a file. Add the following records in it. Sno, Sname, Sadd 50. What is the difference between Close#1 & Close? 51. What is run time property and design time property? 52. What are 3 control types in V.B.? 53. Explain any 3 mouse events. 54. Explain any 3 key press events. 55. Write a program to display what key is pressed from keyboard. 56. Write a program to change a value of text box by Hscrollbar. 57. Write a code to check whether all text boxes are filled or not. 58. Write a program to accept only string or character values from keyboard. Only numeric value in 2 different text boxes. 59. Write following values constants in message box. 0,16,32,48,64 60. State the order in which form events generally trigerred. 61. What is data combo control how is it different from the combo box control? 62. Write code to disable all the text box and command button controls on the form. 63. How can you enable the user to access a menu item from the keyboard? 64. What is .ocx and when it is created? 65. Which are the important built-in events that class support?
66. Explain the following code: Cmd_test_click() If anydate = empty then exit sub If anydate < now then anydate = now timer1.enabled = False End If End Sub 67. How to insert tooltip to a control toolbar button at design time? 68. List the different steps in creating an error handler? 69. What is debug.print and its use? 70. List the different types of error? 71. What is .vbd file? 72. Explain any four debugging tools? 73. What is use of F8 and Shift+F8? 74. Explain Refresh method? 75. Explain the data control count property? SET II
Topic: Introduction to Visual Basic
1. 2. 3. 4. 5. 6. 7.
What are objects and properties? How are they related? (4) What are the steps involved in planning and creating a VB project? (6) What is the purpose of the name property of any control? (4) Describe about the general declaration section of a form module? (4) What are the different types of errors and how are they caused? (8) What do you mean by context-sensitive Help menu? How can you use it? (6) What are the different modes that are available in VB? (6) Topic: More VB Controls
1. 2. 3. 4. 5. 6. 7. 8. 9.
What is the difference between an option button and a check box control? (6) How can you make groups of option buttons? Explain. (8) What do you mean by access keys? Why are they used? (6) What is atooltip? How can you make it to appear? (4) How can you change the labels’ caption during the design time and during the runtime? (4) Explain With block with an example. (8) What is the purpose of image control and how can it be created? (6) What is concatenation and when can it be used? (4) What is the continuation operator? When is it used? (4)
Topic: Variables, Constants and calculations.
1. Name and give the purpose of five data types that are available in VB? (8) 2. What do you mean by declaration of a variable? Explain with proper Syntax? (6) 3. Give the difference between a variable and a constant. (4) 4. What is the purpose of a Val function? (4) 5. Explain in detail about the various functions used for formatting the data? (8) 6. What are the arithmetic operators used in VB? What do you mean by Order of precedence. (6) 7. Explain in detail about the scope of a variable. (8) 8. What are the naming rules and conventions that we follow to declare a variable? (6) Topic: Decisions and conditions.
1. What is the general format of the statement used to code decisions in an application? (6) 2. What are different types of operators do we have in VB? Explain each with an example? (6) 3. How does VB compare the text property of a text box? (6) 4. Explain a Boolean variable test for true and false. Give an example (4) 5. What do you mean by Nested Ifs?(6) 6. When would you use a message box? (4) Topic Menus, submenus, Procedures, Functions
1. 2. 3. 4. 5. 6. 7.
Explain the various parts in the menu editor? (8) What is a separator bar how is it created in a menu? (4) What do you mean by common dialog box? Explain its methods(8) What do you mean by event procedure? (6) What is the difference between a procedure and function? (6) What is a return value? How can it be used? (4) Explain the difference between VyRef and ByVal? Explain with ex? (6) Topic: Multiple forms
1. 2. 3. 4. 5.
What do you mean by multiple forms? (4) What do you mean by Hide and Show form methods? Give the syntax. (4) What is the difference between form load and form activate events? (6) What is the difference between hide and unload form methods? (4) How will you refer the objects on a different form? (4) Topic: Lists, Loops and Printing
1. What is a list box? (4)
2. 3. 4. 5.
What is a combo box? What are its types? (6) What is the difference between a list box and a combo box? (6) Write short notes on listindex and listcount property? (4) What are Loops? Explain with syntax and example about the various Do Loops. (8) 6. What are the steps in processing a for next loop? Explain with examples (6) 7. What is the purpose of printer. Print? (4) 8. How do the left, right and Len functions Operate? (6) Topic Arrays.
1. 2. 3. 4. 5.
What do you mean by an array. Explain with syntax? (6) What is a subscript? What role does it play in a VB application.(4) What is control array? Where is it used? (6) What is a multi-dimensional array? (4) How are list boxes used along with arrays? (6) Topic: OOP-Creating object oriented Programs.
1. What do you mean by an object? How will you instantiate an object? (6) 2. What is the difference between properties and methods? (4) 3. What are the various features of object oriented terminology? (8) 4. Define data hiding. (4) 5. Define encapsulation. (4) 6. What do you mean by Reusable objects? (4) 7. What actions trigger the initialize and terminate events of an object? 8. What is a class? (6) 9. What steps are needed to assign property value to an object? (6) 10. How will you create a new object using a class? (6) 11. Differentiate early binding and late binding. (8) 12. How can you write methods for a new class? (6) 13. Why do you need to terminate a project (4)
Topic: Data Files
1. 2. 3. 4. 5. 6. 7. 8.
What is the difference between a VB Project file and data file? (4) Explain what happens when an open statement is executed? (6) List and explain the file modes for data files. (6) What is the significance of a file number (4) Explain the difference between outputs and append mode. (4) What is the format for the statements to read and write sequential file. (6) What function can be used to determine an available file number? (4) When would an On Error statement be used? (6)
9. Explain the function and use of Err object. (6) 10. What does updating a datafile mean? (6) 11. Explain about the seek function. (6) 12. Explain LOF function. (4) 13. What is the difference between a random and a sequential file? (6) 14. Explain Get statement and Put statement. (4) 15. Explain the form-query Unload procedure with an example. (6) 16. Explain the Resume statement. (4) Topic: Accessing database files.
1. Explain the difference between a data control and data bound control. (6) 2. Which controls can be data bound why? (4) 3. Explain how the BOF and EOF properties are set and how they might be used in a project. (6) 4. Which properties must be set to bind a combo box to a field in a database and display a dropdown list of the choice for that field. (4) 5. How will you update a database file? (6) 6. What steps are needed to add a record to a database? (4) 7. What steps are needed to delete a record from a database? (4) 8. What steps are needed to change a record to in a database record?(4) 9. How can you check for the user deleting the only record in a record set? (4) Topic: Advanced data handling
1. 2. 3. 4. 5. 6. 7.
What is grid control? How will you create it? (8) What is the purpose of record count and absolute position properties? (4) How will you open a database in the form load event? (4) \What do you mean by error trapping? How is it possible? (6) Explain validate event with an example. (6) What is a record set? What are its types? Explain. (8) What are the methods that are available to search for a particular record in a record set? (8) 8. Write short notes on Seek method. (6) 9. How will you suppress system error messages? (4) 10. What is SQL? How is it used in VB? (6) 11. How will you create a new dynaset using SQL statements? Give some examples. (6) 12. For which type of record set is a seek method valid? Which fields in record set can be searched with seek. (4)
Question Papers of Some Colleges
S.I.E.S. College of Commerce, & Economics Sion (E), Mumbai Preliminary Examination, V Semester
Subject : Visual Basic 100 Class : TYBSc(IT) Hours
Max Marks : Date :
Time : 3
N.B :-
1) Q1 is compulsory. 2) Solve any four from the remaining six questions. 2) Figures to the right indicate full marks. 3) Assume suitable data wherever necessary. Q 1 A B C D E F Q 2
A B
Differentiate between Variables & constants. Give Examples. Write the necessary code to produce a color dialog box to change the background color of a command button. What is the difference between a VB Project file and data file? Explain the utility of the following functions with examples i) Mid ii) IsNumeric
(03)
What is the significance of a file number
(03) (03)
Explain the use of the Print method of print class.
Are user defined procedures supported by Visual Basic? If yes, discuss how they can be defined and called with an example. Write the code for the following application An application for a store which deals with only three commodities. Any user coming to
(04) (03) (04)
(07) (06)
the store buys at least buys one item. Every item is available in three packages(by weight). After purchasing, the application should be able to print a bill in the following format: ABC Supermarket Date : MM/DD/YYYY ITEM Rate Qty ABC 10.00 2
Price 20.00
Total : 20
Q 3
C
Explain some methods to debug a VB application.
A
Write a program to display the age of a person if his date of birth is entered. Use suitable ActiveX controls and events. Explain the difference between : #Input & #Output. #Get & #Write. Explain the concept of Control Arrays. Write a VB application for performing mathematical operations (Addition, Subtraction, Division & Multiplication) on numbers in the range 1-5.
(06)
A
Explain the events that are fired when a user presses any key from the keyboard. Give an example for each.
(06)
B
Discuss the general structure of a FOR Loop (04) with an example. Are menus ina VB application accessible (04) through the keyboard ? If yes, explain how? Code a VB application which facilitates storing (06) the items in a list box in a file. It should also have the feature of adding items in the list box at run time such that they are inserted in the file.
B C
Q 4
C D
(06) (2+ 6)
Q 5
A B
C
Q 6
A
Explain the concept of Recordsets, Dynasets and Snapshots. What are types ? How are they declared and accessed ? Give examples.
(06)
C
List different types of operators available in Visual Basic. Explain each of them.
(07)
A
Discuss the concept of Late and Early Binding. (04)
B
Describe the se of Class_initialise and (06) Class_Terminate events. Give examples. Explain with examples different error handling (06) methods in Visual Basic. Code a VB application to retrive, add and delete records from an Access database. Use suitable Controls, events, properties and methods. Apply proper validations.
B
Q 7
Explain the concept of Random files in Visual (07) Basic. How can u delete a record from a random file. Discuss the use of the following functions with (06) examples i) Seek ii) FormatNumber iii) LTrim Write a VB application to calculate the (07) interest earned on a fixed deposit as per the following specifications. a) The user should enter the Principal amount, rate of Interest and period of the deposit( in months) . b) The user should be able to select the option of payment of interest as Monthly, quarterly, yearly or to be paid after maturity of the deposit. c) The deposit should be for a minimum of 6 months duration.
C D
(06)
SIWS College Time : 3 Hrs.
Max Marks : 100
Note : Question 1 is Compulsory. Attempt any 5 out of remaining. Form Design Diagram is necessary for Programs.
Q.1)
Write Short Notes on : (Any 4)
I) II) III) IV) V) VI)
Q.2)
Q.3)
Q.4)
Q.5)
[20]
Naming rules and conventions for Variables Common Dialog box Event Driven Language Arithmetic and Logical Operators Validate and Reposition Events Control Arrays
A)
Explain the following controls with any Events : I) Textbox II) Image
2 properties and
[10]
B)
Create an application that will accept name, quantity price and discount for different products and calculate the net amount. (use appropriate validations)
[6]
A)
Explain the different types of procedures.
[6]
B)
Explain the working of Val function.
[4]
C)
Create an application that will the information of an employee and store in an array. Use a list box to store the names and display the details when user clicks on the name.
[6]
A)
Explain the following options of the menu editor : I) Index II) Enabled and Visible III) Menu Listbox
[6]
B)
Explain the Default and Cancel properties in detail.
[4]
C)
Create an application that will Clear the Textboxes and set the selected property of Listbox and Option buttons to 0 through a procedure in standard code module.
A)
Differentiate between : I) Standard code and Form code module II) Static and Global Variables III) Random and Sequential Files
[6]
B)
Explain the user defined Data types in V.B.
[4]
C)
Create an application that will create a class Student to store Roll no, name and marks of 3 subjects and write a method to calculate the percentage.
[6]
P.T.O.
Q.6)
Q.7)
Q.8)
A)
Explain I) II) III) IV)
the following properties and Methods of a Combobox : Style ItemData ListIndex and NewIndex AddItem
B)
Create an application that will create a Data file and Store the names and phone numbers. Copy the contents in another file when user clicks on BACKUP button.
[8]
A)
Explain the use of following functions : I) Open II) LOF III) FreeFile
[6]
B)
Explain the use of Message Box.
[4]
C)
Create an application that will Accept data of book and store in a database file. Provide navigation buttons for display of records. (Use Error trapping code and set the properties of data control during run time.)
[6]
A)
Explain the different types of Recordsets.
[6]
B)
What are Data bound controls? Explain with example.
[4]
C)
Create an application that will search for a record in a table type of record set and delete the record. Give a prompt for confirmation of deletion.
[6]
The next set of questions will be sent in a day or two with question papers of some more colleges.
[8]