JAYASHREE ORACLE CERTIFIED JAIN UNIVERSITY

Monday, December 13, 2010

Refer these blogs for all subjects

http://jayashree-ds.blogspot.com/
http://jayashree-webprogramming.blogspot.com/
http://jayashree-sqlplsql.blogspot.com/
http://jayashree-dbms.blogspot.com/
http://cprogramming-jayashree.blogspot.com/
http://bca-3sem-vb.blogspot.com/
http://bca-3sem-se.blogspot.com/
http://bca-3sem-cpp.blogspot.com/

Tuesday, September 28, 2010

BLOGS for Different Subjects

http://jayashree-sqlplsql.blogspot.com/
http://bca-3sem-vb.blogspot.com/
http://bca-3sem-cpp.blogspot.com/
http://jayashree-dbms.blogspot.com/
http://cprogramming-jayashree.com
http://bca-3sem-se.blogspot.com/

Sunday, September 26, 2010

JU BCA IIIrd SEM 1st Chapter OOP's

Chapter I

Visual Programming

1.1 OOP’s:

OOP is a design philosophy. It stands for Object Oriented Programming. Object-Oriented Programming (OOP) uses a different set of programming languages than old procedural programming languages (C, Pascal, etc.). Everything in OOP is grouped as self sustainable "objects". Hence, you gain re-usability by means of four main object-oriented programming concepts.

In order to clearly understand the object orientation, let’s take your “hand” as an example. The “hand” is a class. Your body has two objects of type hand, named left hand and right hand. Their main functions are controlled/ managed by a set of electrical signals sent through your shoulders (through an interface). So the shoulder is an interface which your body uses to interact with your hands. The hand is a well architected class. The hand is being re-used to create the left hand and the right hand by slightly changing the properties of it.

1.2 Object:

An object can be considered a "thing" that can perform a set of related activities. The set of activities that the object performs defines the object's behavior. For example, the hand can grip something or a Student (object) can give the name or address.

In pure OOP terms an object is an instance of a class.

1.3 Class:

A class is simply a representation of a type of object. It is the blueprint/ plan/ template that describe the details of an object. A class is the blueprint from which the individual objects are created. Class is composed of three things: a name, attributes, and operations.

For example :

public class Student

{

}

According to the sample given below we can say that the student object, named objectStudent, has created out of the Student class.

Student objectStudent = new Student();

In real world, you'll often find many individual objects all of the same kind. As an example, there may be thousands of other bicycles in existence, all of the same make and model. Each bicycle has built from the same blueprint. In object-oriented terms, we say that the bicycle is an instance of the class of objects known as bicycles.

In the software world, though you may not have realized it, you have already used classes. For example, the TextBox control, you always used, is made out of the TextBox class, which defines its appearance and capabilities. Each time you drag a TextBox control, you are actually creating a new instance of the TextBox class.

1.4 How to identify and design a Class?

This is an art; each designer uses different techniques to identify classes. However according to Object Oriented Design Principles, there are five principles that you must follow when design a class,

  • SRP - The Single Responsibility Principle -
    A class should have one, and only one, reason to change.
  • OCP - The Open Closed Principle -
    You should be able to extend a classes behavior, without modifying it.
  • LSP - The Liskov Substitution Principle-
    Derived classes must be substitutable for their base classes.
  • DIP - The Dependency Inversion Principle-
    Depend on abstractions, not on concretions.
  • ISP - The Interface Segregation Principle-
    Make fine grained interfaces that are client specific.

Additionally to identify a class correctly, you need to identify the full list of leaf level functions/ operations of the system (granular level use cases of the system). Then you can proceed to group each function to form classes (classes will group same types of functions/ operations). However a well defined class must be a meaningful grouping of a set of functions and should support the re-usability while increasing expandability/ maintainability of the overall system.

In software world the concept of dividing and conquering is always recommended, if you start analyzing a full system at the start, you will find it harder to manage. So the better approach is to identify the module of the system first and then dig deep in to each module separately to seek out classes.

A software system may consist of many classes. But in any case, when you have many, it needs to be managed. Think of a big organization, with its work force exceeding several thousand employees (let’s take one employee as a one class). In order to manage such a work force, you need to have proper management policies in place. Same technique can be applies to manage classes of your software system as well. In order to manage the classes of a software system, and to reduce the complexity, the system designers use several techniques, which can be grouped under four main concepts named Encapsulation, Abstraction, Inheritance, and Polymorphism. These concepts are the four main gods of OOP world and in software term, they are called four main Object Oriented Programming (OOP) Concepts.

1.5 Encapsulation

The encapsulation is the inclusion within a program object of all the resources need for the object to function - basically, the methods and the data. In OOP the encapsulation is mainly achieved by creating classes, the classes expose public methods and properties. The class is kind of a container or capsule or a cell, which encapsulate the set of methods, attribute and properties to provide its indented functionalities to other classes. In that sense, encapsulation also allows a class to change its internal implementation without hurting the overall functioning of the system. That idea of encapsulation is to hide how a class does it but to allow requesting what to do.

In order to modularize/ define the functionality of a one class, that class can uses functions/ properties exposed by another class in many different ways. According to Object Oriented Programming there are several techniques, classes can use to link with each other and they are named association, aggregation, and composition.

There are several other ways that an encapsulation can be used, as an example we can take the usage of an interface. The interface can be used to hide the information of an implemented class.

1.6 Association:

Association is a (*a*) relationship between two classes. It allows one object instance to cause another to perform an action on its behalf. Association is the more general term that define the relationship between two classes, where as the aggregation and composition are relatively special.

Collapse

public class StudentRegistrar

{

public StudentRegistrar ();

{

new RecordManager().Initialize();

}

}

In this case we can say that there is an association between StudentRegistrar and RecordManager or there is a directional association from StudentRegistrar to RecordManager or StudentRegistrar use a (*Use*) RecordManager. Since a direction is explicitly specified, in this case the controller class is the StudentRegistrar.

To some beginners, association is a confusing concept. The troubles created not only by the association alone, but with two other OOP concepts, that is association, aggregation and composition. Every one understands association, before aggregation and composition are described. The aggregation or composition cannot be separately understood. If you understand the aggregation alone it will crack the definition given for association, and if you try to understand the composition alone it will always threaten the definition given for aggregation, all three concepts are closely related, hence must study together, by comparing one definition to another. Let’s explore all three and see whether we can understand the differences between these useful concepts.

1.7 Difference between Association, Aggregation and Composition?

Association is a (*a*) relationship between two classes, where one class use another. But aggregation describes a special type of an association. Aggregation is the (*the*) relationship between two classes. When object of one class has an (*has*) object of another, if second is a part of first (containment relationship) then we called that there is an aggregation between two classes. Unlike association, aggregation always insists a direction.

public class University

{

private Chancellor universityChancellor = new Chancellor();

}

In this case I can say that University aggregate Chancellor or University has an (*has-a*) Chancellor. But even without a Chancellor a University can exists. But the Faculties cannot exist without the University, the life time of a Faculty (or Faculties) attached with the life time of the University . If University is disposed the Faculties will not exist. In that case we called that University is composed of Faculties. So that composition can be recognized as a special type of an aggregation.

Same way, as another example, you can say that, there is a composite relationship in-between a KeyValuePairCollection and a KeyValuePair. The two mutually depend on each other.

.Net and Java uses the Composite relation to define their Collections. I have seen Composition is being used in many other ways too. However the more important factor, that most people forget is the life time factor. The life time of the two classes that has bond with a composite relation mutually depend on each other. If you take the .net Collection to understand this, there you have the Collection Element define inside (it is an inner part, hence called it is composed of) the Collection, forcing the Element to get disposed with the Collection. If not, as an example, if you define the Collection and it’s Element to be independent, then the relationship would be more of a type Aggregation, than a Composition. So the point is, if you want to bind two classes with Composite relation, more accurate way is to have a one define inside the other class (making it a protected or private class). This way you are allowing the outer class to fulfill its purpose, while tying the lifetime of the inner class with the outer class.

So in summary, we can say that aggregation is a special kind of an association and composition is a special kind of an aggregation. (Association->Aggregation->Composition)







1.8 Inheritance:

Ability of a new class to be created, from an existing class by extending it, is called inheritance.


public class Exception

{

}

public class IOException : Exception

{

}

According to the above example the new class (IOException), which is called the derived class or subclass, inherits the members of an existing class (Exception), which is called the base class or super-class. The class IOException can extend the functionality of the class Exception by adding new types and methods and by overriding existing ones.

Just like abstraction is closely related with generalization, the inheritance is closely related with specialization. It is important to discuss those two concepts together with generalization to better understand and to reduce the complexity.

One of the most important relationships among objects in the real world is specialization, which can be described as the “is-a” relationship. When we say that a dog is a mammal, we mean that the dog is a specialized kind of mammal. It has all the characteristics of any mammal (it bears live young, nurses with milk, has hair), but it specializes these characteristics to the familiar characteristics of canis domesticus. A cat is also a mammal. As such, we expect it to share certain characteristics with the dog that are generalized in Mammal, but to differ in those characteristics that are specialized in cats.

The specialization and generalization relationships are both reciprocal and hierarchical. Specialization is just the other side of the generalization coin: Mammal generalizes what is common between dogs and cats, and dogs and cats specialize mammals to their own specific subtypes.

Similarly, as an example you can say that both IOException and SecurityException are of type Exception. They have all characteristics and behaviors of an Exception, That mean the IOException is a specialized kind of Exception. A SecurityException is also an Exception. As such, we expect it to share certain characteristic with IOException that are generalized in Exception, but to differ in those characteristics that are specialized in SecurityExceptions. In other words, Exception generalizes the shared characteristics of both IOException and SecurityException, while IOException and SecurityException specialize with their characteristics and behaviors.

In OOP, the specialization relationship is implemented using the principle called inheritance. This is the most common and most natural and widely accepted way of implement this relationship.

1.9 Polymorphisms:

Polymorphisms is a generic term that means 'many shapes'. More precisely Polymorphisms means the ability to request that the same operations be performed by a wide range of different types of things.

At times, I used to think that understanding Object Oriented Programming concepts have made it difficult since they have grouped under four main concepts, while each concept is closely related with one another. Hence one has to be extremely careful to correctly understand each concept separately, while understanding the way each related with other concepts.

In OOP the polymorphisms is achieved by using many different techniques named method overloading, operator overloading and method overriding,

1.10 Method Overloading?

The method overloading is the ability to define several methods all with the same name.

Collapse

public class MyLogger

{

public void LogError(Exception e)

{

// Implementation goes here

}

public bool LogError(Exception e, string message)

{

// Implementation goes here

}

}

1.11 Operator Overloading?

The operator overloading (less commonly known as ad-hoc polymorphisms) is a specific case of polymorphisms in which some or all of operators like +, - or == are treated as polymorphic functions and as such have different behaviors depending on the types of its arguments.

public class Complex

{

private int real;

public int Real

{

Get

{

return real;

}

}

private int imaginary;

public int Imaginary

{

Get

{

return imaginary;

}

}

public Complex(int real, int imaginary)

{

this.real = real;

this.imaginary = imaginary;

}

public static Complex operator +(Complex c1, Complex c2)

{

return new Complex(c1.Real + c2.Real, c1.Imaginary + c2.Imaginary);

}

}

I above example I have overloaded the plus operator for adding two complex numbers. There the two properties named Real and Imaginary has been declared exposing only the required “get” method, while the object’s constructor is demanding for mandatory real and imaginary values with the user defined constructor of the class.

1.12 Method Overriding?

Method overriding is a language feature that allows a subclass to override a specific implementation of a method that is already provided by one of its super-classes.

A subclass can give its own definition of methods but need to have the same signature as the method in its super-class. This means that when overriding a method the subclass's method has to have the same name and parameter list as the super-class's overridden method.

using System;

public class Complex

{

private int real;

public int Real

{

get

{

return real;

}

}

private int imaginary;

public int Imaginary

{

get

{

return imaginary;

}

}

public Complex(int real, int imaginary)

{

this.real = real;

this.imaginary = imaginary;

}

public static Complex operator +(Complex c1, Complex c2)

{

return new Complex(c1.Real + c2.Real, c1.Imaginary + c2.Imaginary);

}

public override string ToString()

{

return (String.Format("{0} + {1}i", real, imaginary));

}

}

In above example I have extended the implementation of the sample Complex class given under operator overloading section. This class has one overridden method named “ToString”, which override the default implementation of the standard “ToString” method to support the correct string conversion of a complex number.

Complex num1 = new Complex(5, 7);

Complex num2 = new Complex(3, 8);

// Add two Complex numbers using the

// overloaded plus operator

Complex sum = num1 + num2;

// Print the numbers and the sum

// using the overriden ToString method

Console.WriteLine("({0}) + ({1}) = {2}", num1, num2, sum);

Console.ReadLine();

1.13 Abstraction and Generalization?

Abstraction is an emphasis on the idea, qualities and properties rather than the particulars (a suppression of detail). The importance of abstraction is derived from its ability to hide irrelevant details and from the use of names to reference objects. Abstraction is essential in the construction of programs. It places the emphasis on what an object is or does rather than how it is represented or how it works. Thus, it is the primary means of managing complexity in large programs.

While abstraction reduces complexity by hiding irrelevant detail, generalization reduces complexity by replacing multiple entities which perform similar functions with a single construct. Generalization is the broadening of application to encompass a larger domain of objects of the same or different type. Programming languages provide generalization through variables, parameterization, generics and polymorphism. It places the emphasis on the similarities between objects. Thus, it helps to manage complexity by collecting individuals into groups and providing a representative which can be used to specify any individual of the group.

Abstraction and generalization are often used together. Abstracts are generalized through parameterization to provide greater utility. In parameterization, one or more parts of an entity are replaced with a name which is new to the entity. The name is used as a parameter. When the parameterized abstract is invoked, it is invoked with a binding of the parameter to an argument.






1.14 Abstract classes

Abstract classes, which declared with the abstract keyword, cannot be instantiated. It can only be used as a super-class for other classes that extend the abstract class. Abstract class is the concept and implementation gets completed when it is being realized by a subclass. In addition to this a class can inherit only from one abstract class (but a class may implement many interfaces) and must override all its abstract methods/ properties and may override virtual methods/ properties.

Thursday, September 23, 2010

JAIN UNIVERSITY VB QUESTION BANK

Question Bank

On
Visual Programming
For IV SEMESTER


UNIT-2 INTRODUCTION TO VB

Two mark Questions:

What is Visual Basic?
When and who developed Visual Basic?
Which are the three editions of Visual Basic?
Expand COM and DCOM?
Define IntelliSense?
What is the use of ADODC control?
What are Addins?
What do you mean by Title Bar?
What do you mean by Menu Bar?
What do you mean by Tool bars?
What is a Option Button?
What is a List box?
What is a Combo box?
What is a Timer?
What is Drive List box?
What is Dir List box?
What is Form Layout Window?
What is a Resource File?
What is a Project File?
What is ActiveX Control File?

Five marks Questions:

Explain the three editions of Visual Basic?
Describe any four features of Visual Basic?
Explain any three IDE components of Visual Basic?
Explain any three controls of Visual Basic?
Name the different types of projects that can be created in VB?
What are the different options available in Menu bar?
How is the Immediate Window used in VB?
Explain the function of Properties Window?
Explain the function of Project Window?
Define IntelliSense? Mention its features?
Ten marks Questions:

What is IDE? Discuss the features of Visual Basic IDE?
Explain the different Windows available in Standard EXE project of VB?
Explain the important features of VB?
Explain briefly the usage of any five controls in the Toolbox?
Create a VB program to input two numbers add display their sum?




UNIT 3: PROGRAMMING IN VB

Two Mark Questions

Name the three special values in Visual Basics.
What is an Empty Value?
What is a Null Value?
Name any two Visual Basic functions for data type conversions.
Which function is used to find the data type of an argument?
What is a local variable?
What is a global variable?
Which keyword is used to preserve the value of a local variable?
What are the two types of constants?
How are system-defined and user-defined constants declared?
Name the three types of operators in Visual Basics.
Name any two arithmetic operators.
Name any two relational operators.
Name any two logical operators?
What is REM statement?
What are the decision structures available in Visual Basics?
Name the looping structures in Visual Basics?
What are entry-controlled loops?
What are exit-controlled loops?
What is an END statement?
21. What are user-defined data types? 22. Define array 23.What is multi-dimensional array? 24. Define a function 25.What is an event? 26. What is a general procedure? 27. Define event procedure 28.What is an argument?
29. How do you declare an array in Visual Basic? 30. How do you force a variable declaration?

Five Marks Questions

What are other similar functions like IsNull() function to check a variable’s data type? Explain.
What does VarType () do? Write its syntax.
Give an example to illustrate the usage of VarType () functions.
What is an REM statement? Write its syntax and an example.
What is If-Then-End If structure? Write its general form with an example.
What is If-Then-Else-End If structure? Write its general form.
What is Select Case? Write its general syntax.
Write the description and usage of the Do-loop statement.
Write the description and usage of the While-wend statement.
Write the description and usage of the For-Next statement.
Write the description and usage of the For Each-Next statement.
List any 4 different forms of End statement.
13. Explain user-defined data type with a syntax 14.what are multi-dimensional arrays? 15. Explain the concept of dynamic arrays? 16. Briefly explain event procedure with syntax? 17. Differentiate between general procedure and event procedure 18.what is a function? How is it declared and called? 19. What is the difference between function and a procedure?

Ten Mark Questions

What are the three special values? Explain each one of them with syntax.
List all the conversion functions in Visual Basics and write their usage.
Write the scope and lifetime of a variable.
Write a VB program to find the largest of three numbers along with the form design.
Write a VB program to process the grades of a student along with the form design.
Write all the looping structures of VB and give their description and usage as well.
Write a program to find the GCD of two integers using the different looping structures.
Write a program to count the number of Labels, Text Boxes and command Buttons in the form.



UNIT 4: FORM OBJECT AND CONTROLS

Two marks questions

1. Define a form object.
2. What is a menu?
3. What is the need of control array?
4. What are the advantages of control arrays?
5. What are events? Give an example.
6. What are methods? Give an example.
7. What are Intrinsic controls?
8. List the common properties of a command button.
9. Give the common events used in command button
10. Give any three events relatede to list box
11. What do you mean by OLE control?
12. List out some important microsoft common controls
13. What is a tool bar?
14. What are the advantagesof the tool bar?
15. Wat do you mean by MDI form?



Five marks questions

1. Give the naming conventions of any 3 controls.
2. Explain the form related events of visual basic.
3. Explain the form related methods of visual basics.
4. How are controls created and removed?
5. Explain loading and unloading of the forms.
6. Explain any 3 properties of a Form object.
7. Describe the basic properties of a textbox
8. Describe any three methods used in command button
9. Explain any three common properties of a control
10. Describe frame control with an example
11. Describe the checkbox control
12. Describe option button with an example
13. Differentiate between checkbox control and optionbutton control
14. Explain the salient features of listbox.
15. Explain the salient features of combobox.
16. Give the difference between data time picker control and timer control.
17. Describe the salient features of a toolbar
18. How is timer control used?
19. Describe the properties of scrollbar.
20. Explain the events and methods of a scroll bar
21. What are the advantagesof the tool bar? how is it differ from a menubar.





Ten marks questions

1. Explain the common dialog control in visual basic
2. How is a control array created at design time and run time?
3. Compare listbox and combobox
4. Give the difference between image box and picture box controls
5. What is menu? Explain the steps of creating a menu with a suitable example.
6. Explain the usage of list box and combo box with suitable examples.
7. What is an MDI form and what are its properties? explain with an example.
8. Outline a visual basic program for displaying the grade of the student in a text box based on then marks of a student as follows:

Marks >90 80-90 70-79 60-69 50-59 <50
Grade S A B C D E

9. Write a visual basic program to simulate a calculator.
10. Create an application program to accept employee information and display it using message box. Give the design, properties and code.





UNIT 5: DATABASE CONNECTIVITY

Two Marks questions


1. What are the features of ADO Data Control?
2. Explain data aware controls?
3. List any three properties of ADO data control?
4. List any three events of ADO data control?
5. What is the function of data combo control?
6. How's the Data Grid control used in VB application?
7. Explain the different types of Record Sets?
8. What are the advantages of an ActiveX data object?
9. Explain the top level objects of an ADO object model.
10. What is a connection object?
11. Explain the Command Type property.
12. What is a Command object? Explain.
13. What are the most common methods used with the command object?
14. What is a RecordSet? Explain.
15. List some common properties of a Record Set object?
16. What is a field? Give some common properties of a field object.



Ten Marks Question

1. What are the differences b/w a Combo box and the Data Combo control? Explain with an example.
2. Differentiate b/w a List Box and a Data List control. Illustrate with an example.
3. Explain any three controls used in VB to manipulate data retrieved from tables.
4. Discuss the open method for an ADO connection.
5. Explain the open method for a Record Set.
6. Explain the execute method.
7. Write a VB program to print the discount based on the category.

category Discount
1 50% on MRP
2 40% on MRP
3 30% on MRP
4 20% on MRP

8. Develop a VB program to display records from database using ADODC control.
9. Write the steps to add, delete, and search data using an ADO Control.
10. Design and code an application to accept the employee information and display it using Message Box.
11. Write a VB program to accept data through a form and store the following in a database: student No., name and marks. Also display student scoring marks more than fifty.

VB CODE to HANDLE DATABASE USING ADODC1

Private Sub cmdaddnew_Click()
Adodc1.Recordset.AddNew
End Sub

Private Sub cmdCancel_Click()
txttitle.Text = ""
txtpublisher.Text = ""
txtauthor.Text = ""


txtisbn.Text = ""
txtyr.Text = ""
End Sub

Private Sub cmddel_Click()
Confirm = MsgBox("Are you sure you want to delete this record?", vbYesNo, "Deletion Confirmation")
If Confirm = vbYes Then
Adodc1.Recordset.Delete
MsgBox "Record Deleted!", , "Message"
Else
MsgBox "Record Not Deleted!", , "Message"
End If
End Sub

Private Sub cmdedit_Click()
txtisbn.SetFocus

End Sub

Private Sub cmdfind_Click()



SQL = "Select * from books where isbn=" & txtisbn.Text
'create a connection
Dim cn As New ADODB.Connection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\jay\Desktop\VB\LIB.MDB;Persist Security Info=False"
'create a recordset
Dim rs As New ADODB.Recordset
'open the connection
cn.Open
'execute the sql statement
Set rs = cn.Execute(SQL)

If rs.EOF Then
MsgBox ("Record not Found")
Else

txttitle.Text = rs(1)
txtauthor.Text = rs(2)
txtpublisher.Text = rs(3)
txtyr.Text = rs(4)

End If
'Close Connection
' cn.Close
End Sub

Private Sub cmdmovenext_Click()
If Not Adodc1.Recordset.EOF Then
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF Then
Adodc1.Recordset.MovePrevious
End If
End If
End Sub

Private Sub cmdmoveprev_Click()
If Not Adodc1.Recordset.BOF Then
Adodc1.Recordset.MovePrevious
If Adodc1.Recordset.BOF Then
Adodc1.Recordset.MoveNext
End If
End If
End Sub

Private Sub cmdsave_Click()
' Adodc1.Recordset.Update

Adodc1.Recordset.Fields("ISBN") = txtisbn.Text
Adodc1.Recordset.Fields("title") = txttitle.Text
Adodc1.Recordset.Fields("author") = txtauthor.Text
Adodc1.Recordset.Fields("publisher") = txtpublisher.Text
' Adodc1.Recordset.Fields("year") = txtyr.Text
Adodc1.Recordset.Update

MsgBox ("One Record Saved")
End Sub

Private Sub cmdstop_Click()

End Sub

Private Sub DataCombo1_Click(Area As Integer)

' SQL = "Select * from books" + " where author= ' " + DataCombo1 + " ' "
' Adodc1.Refresh
' 'create a connection
' Dim cn As New ADODB.Connection
' cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\jay\Desktop\VB\LIB.MDB;Persist Security Info=False"
' 'create a recordset
' Dim rs As New ADODB.Recordset
' 'open the connection
' cn.Open
' 'execute the sql statement
' Set rs = cn.Execute(SQL)
'
' Set DataGrid1.DataSource = rs


Adodc1.RecordSource = " Select * from books " & " where title= ' " + DataCombo1 + " ' "
txtisbn.Text = Adodc1.Recordset.Fields(0)
txttitle.Text = Adodc1.Recordset.Fields(1)
txtauthor.Text = Adodc1.Recordset.Fields(2)
txtpublisher.Text = Adodc1.Recordset.Fields(3)
txtyr.Text = Adodc1.Recordset.Fields(4)
' Adodc1.Refresh



'Close Connection
' cn.Close

End Sub





Private Sub txttitle_gotfocus()
If IsNumeric(txtisbn.Text) = False Then

MsgBox "Type Error", vbCritical
txtisbn.Text = ""
txtisbn.SetFocus

Exit Sub

End If


End Sub



Private Sub txtyr_LostFocus()
If IsDate(txtyr.Text) = False Then
MsgBox "enter in date format dd/mm/yy", vbCritical
End If
End Sub

CHECKING FOR VALID USER NAME PASSWORD FROM THE DATABASE

Dim flag
Private Sub cmdlogin_Click()
    While Not Data1.Recordset.EOF
        If Data1.Recordset.Fields(0) = Text1.Text And Data1.Recordset.Fields(1) = Text2.Text Then
            flag = 1
            GoTo valid:
        Else
            flag = 0
            Data1.Recordset.MoveNext
        End If
    Wend

valid:
    If flag = 1 Then
        MsgBox "Valid User"
    Else
        MsgBox "inValid User"
    End If

End Sub

Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
End Sub

VB MODEL QUESTION PAPER FOR IIIrd SEM BCA


Model Question Paper
BCA III  Sem
Visual Programming

QI:   Answer any ten of the following                                               10*2=20

  1. What is an object?
  2. Define polymorphism?
  3. What is abstraction?
  4. Describe any four features of Visual Basic?
  5. Define array with syntax and example.                                                                                                
  6. What is Select Case? Write its syntax.
  7. What is Function? Write its general syntax.
  8. List all operators in VB.
  9.  What is the use of ADODC control in VB.
  10. What is a Combo box? List its properties and methods
  11. Write the properties of DATA1 control.
  12. What are data aware controls?
  13. What is recordset?
  14. List some file controls.
  15. What is MS Flexgrid control?

QII : Answer any six of the following                                                    6*5=30                                                                    

  1. Implement program to illustrate polymorphism concept in VB.
  2. Explain IDE in VB.
  3. Explain all data types in VB.
  4. Implement VB program to checking an element present in an array or not by using required control.
  5. What is Scrollbar? Explain the properties and methods
  6. Implement the program generate the Fibonacci series
  7. Write the steps to create the connection with the database MS Access
  8. Explain the MDI Form.

QIII : Answer any three of the following                                              3*10= 30

      24. Explain Object oriented analysis and Object Oriented Database.           
      25.Explain all looping statements in VB with simple example.
      26. Write a VB program to process the grades of a student along with the form design.
      27.What is common dialog control? Explain all methods and properties with example
      28. Implement the VB program to maintain the employee information using MS ACCESS and ADODC1 cntrol( empno, ename, dept-no, salary, HRA, TA, DA and netsalary )