Monday, October 24, 2011

IGNOU BCA ASSIGNMENTS Year, 2011 (4th Semester) CS-06, CS-64, CS-65, CS-66, CS-67

1. IGNOU BCA-CS-06 Assignment 2011(solved)
2. IGNOU BCA-CS-64 Assignment 2011(solved)
3. IGNOU BCA-CS-65 Assignment 2011(solved)
4. IGNOU BCA-CS-66 Assignment 2011(solved)
5. IGNOU BCA-CS-67 Assignment 2011(solved)

Course Code : CS-06
Course Title : Introduction to DBMS
Assignment Number : BCA (4)-06/Assignment/ 2011
Maximum Marks : 100 (Weightage 25%)
Last Date of Submission : 30th April, 2011/30th October, 2011

There are five questions in this assignment. Answer all the questions. You may use illustrations and diagrams to enhance the explanations. Please go through the guidelines regarding assignments given in the Programme Guide for the format of presentation. Answer to each part of the question should be confined to about 300 words.

Question 1: What is Normalization? Explain the condition under which a relation needs to be normalized to 3 NF fro3 2 NF with the help of an example? (5 Marks)

Question 2: Compare primary, secondary and clustering indexes. Which of these indexes are dense and which are not? (5 Marks)

Question 3: What is difference between B tree and B+ tree? Why a B+ tree is a better tree structure than a B tree for implementation of an indexed sequential file. (5 Marks)

Question 4: Consider the following employee database schema:


Perform the following queries using SQL (5 Marks)

(a) Find the details of dependent for employee having name ABC.
(b) Find the name of manager of the department in which employee whose ESSN code is 1234
(c) Find the name of all employees whose age is less than 18 years.
(d) Find the DOB of the son of employee having employee code ESSN 5078

Question 5: Describe the benefits of data replication in DDBBMS? What typical units of data are replicated in the process of data replication? (5 Marks)

Course Code : CS-64
Course Title : Introduction to Computer Organisation
Assignment Number : BCA (4)-64/Assignment/ 2011
Maximum Marks : 100 (Weightage 25%)
Last Date of Submission : 30th April, 2011/30th October, 2011

There are three questions in this assignment. Answer all the questions. You may use illustrations and diagrams to enhance your explanations. Please go through the guidelines regarding assignments given in the Programme Guide for the format of presentation. Answer to each part of the question should be confined to about 300 words.

Questions 1: (covers block 1)

(a) Convert the following numbers as asked: (4 Marks)
(i) Decimal 2501 to Hexadecimal
(ii) Octal 230 to Hexadecimal
(iii) Hexadecimal 59FF to Decimal
(iv) Hexadecimal 67AB to Octal

(b) Assume that a computer represents integers in signed 2’s complementation notation having the size of 8 bits. You may also assume that all the registers used for integer arithmetic are also of 8 bits. Perform the following operations using this computer (the numbers indicated in the operations are decimal numbers). You must indicate the overflow condition, if any. (4 Marks)
(i) Add -39 and -89
(ii) Subtract 49 from 48
(iii) Add 78 and 50
(iv) Subtract -25 from -24

(c) A four bit data 1001 is to be sent across a communication channel. How can SEC code be used to ensure that the data is received correctly at the destination? (6 Mark)

(d) Assume that a number comparator compares two numbers A and B of two bits each. The comparator output two bits – the first one output the result of comparison (1 if same 0 otherwise) and second one output 1 if both A and B are zero, otherwise 1. The partial truth table for the comparator is given below:

Number A Number B Output
Bit 1 Bit 0 Bit 1 Bit 0 Same Zero
0 0 0 0 1 1
0 0 0 1 0 0
0 0 1 0 0 0
0 0 1 1 0 0
0 1 0 0 0 0
0 1 0 1 1 0

Complete the truth table and design and draw the combinational circuit using AND-OR-NOT gates for the description given above. (6 Marks)

(e) What is a flip-flop? Explain the characteristics table of S R flip flop. How are master slave flip flops different to simple flip-flops (4 Marks)

(f) Explain the direct cache memory organization with the help of a diagram. In the present day computer L1, L2 and L3 cache is being used. What are these cache memories? Find out their sizes. (4 Marks)

(g) “A disk interrupt is given higher priority than the keyboard interrupt. The main reason for this is the access mechanism of a Magnetic disk.” Is the statement given above correct? Justify your answer. What is the need of RAID? Give specification of a commercial RAID architecture. (4 Marks)

(h) Define the term Direct Memory Access in Computer. What is the need of DMA? Compare DMA with I/O processor. In the present day computer, how I/O devices are connected to CPU/Memory. (4 Marks)

Questions 2: (covers block2)

(a) How does the number of operand addresses in an Instruction Set affect the size of a program on a computer? Find the instruction set for a Pentium processor. What are the key features of its instruction set?
(4 Marks)

(b) Assume a machine whose instructions have only two register operands. The values are loaded the register by a load instruction and results are stored in the memory using a store instruction. Select four best addressing modes for the machine. Give reasons for your selection. (4 Marks)

(c) Consider the instruction Subtract Op1, Op2 where Op1 is a register operand and Op2 is a memory operand. This instruction subtracts the value stored in operand Op2 from the Operand Op1 and stores the result into Op1. Write the sequence of micro-operations that will be required to execute this instruction. You may use various micro-operation cycles and the necessary registers. (6 Marks)

(d) Assume that an 8-bit Register R has the data 10110100. Perform the following operations on the register R: (4 Marks)
(i) Selective Set the higher 4 bits to 0110
(ii) Extract the higher 4 bits
(iii) Make all the bits as Zero in the register using a logical operation
(iv) Insert a value 1110 in the lower 4 bits of the register.

(e) Represent the following floating point numbers using IEEE 754 floating point single precision format.
i) 28.125
ii) -0.000125
(4 Marks)
(f) What is a micro-instruction? Explain the different types of Micro-instructions in a computer. What is a micro program? Explain how a micro-program results in execution of an instruction with the help of an example.
(8 Marks)
Questions 3: (covers block 3)

(a) What is the need of segments in 8086 micro-processor? Explain how the address of an instruction is calculated in 8086 using segment register(s).
(4 Marks)
(b) Explain the CALL, DAA, TEST, RET instructions of 8086 processor with the help of one example each. (4 Marks)

(c) Explain any four indirect addressing modes of 8086 microprocessor with the help of an example of each. (4 Marks)

(d) Explain the process of handling an Interrupt in 8086 microprocessor with the help of an example/ diagram. (4 Marks)

(e) Write a program in 8086 assembly language that finds the length of a string. You may assume that the string is stored in the memory and is terminated by the character $. The calculated length of the string may be stored in a location labeled “Length”. (8 Marks)

(f) Write a program in 8086 assembly language that passes one parameter to a subroutine through a stack. The subroutine return a value 0 in case the value is less than or equal to zero or 1 if value is above zero. Make suitable assumptions, if any.
(10 Marks)

Course Code : CS-65
Course Title : Windows Programming
Assignment Number : BCA(4)-65/Assignment/2011
Maximum Marks : 25
Last Date of Submission : 30th April, 2010/ 30th October, 2011

There are five questions in this Assignment. Answer all the questions. You may use illustrations and diagrams to enhance explanations.

Question 1: Design a database application to maintain BCA Students Examination Records and to generating the Hall Tickets for eligible students using Visual Basic. Provide necessary documentation, reports, screen layouts etc. for the project.
(7 Marks)

Question 2: What is a significance of data control? How are these used? Explain.
(3 Marks)

Question 3: What is the difference between passing by value & passing arguments by reference in Visual Basic 6 Procedures? How declaration is done in either case?
(5 Marks)

Question 4: What are Dynamic arrays? Illustrate using code segments how it can be managed?
(5 Marks)

Question 5: How is password field added in Visual Basic? How can a user execute SQL SELECT WHERE & ORDER BY queries from inside a form?
(5 Marks)

Note: Assumptions can be made wherever necessary.

Course Code : CS-66
Course Title : Multimedia
Assignment Number : BCA (4)-66 Assignment/2011
Maximum Marks : 25
Last Date of submission : 30th April, 2011 (For January Session)
30th October, 2011 (For July Session)

There are five questions in this assignment. Answer all the questions. You may use illustrations and diagrams to enhance explanations.

Question 1: Define the term Multimedia. What is need of multimedia software? List four software used in multimedia industry. (5 Marks)

Question 2: What is collaborative learning? Explain the process of collaborative learning using Multimedia, with an example. (5 Marks)

Question 3: List the hardware and software components essential for professional multimedia application development. Also, justify the purpose and need of each of the hardware components. (5 Marks)

Question 4: Differenciate between the following: (4 Marks)
(a) E-mail and Voice mail
(b) Vector image and Bitmap Image
(c) CD ROM and DVD ROM
(d) Animation and Digital Video

Question 5: Discuss how multimedia can be used for the following application areas:
(6 Marks)
(a) Fashion Industry
(b) Flight and Aviation Institute
(c) Advertisement Industry

Course Code : CS-67
Course Title : RDBMS Lab
Assignment Number : BCA (4)-67/Assignment/ 2011
Maximum Marks : 100
Last Date of Submission : 30th April, 2011/30th October, 2011
Answer all the questions. You may use examples illustrations or diagrams to support your answer. You have to implement the database system using any RDBMS.
A Central University runs from its main campus and a number of associated colleges. The University has several programmes ranging from Diploma (1 year duration), Bachelor’s degree (3 or 4 year’s duration), Post Graduation (2 to 3 years duration) and research degree programmes (2-3 years duration). The structure of each programme is approved centrally. A programme may be offered through the main campus or associated college. The students are registered centrally in a programme and college of his/her choice. The fee is also paid centrally yearly. The final data of admission can be obtained by the colleges through a query to the central database. The University has a centralized examination system. It conducts the examination of the students in various courses of various programmes. For simplicity you may assume that a programme of the University only have three compulsory courses in a year. Perform the following tasks for the University. Please make and state assumptions, if any.
Question 1: (10 Marks)
List the entities, their attributes and relationships for the description and make an ER-diagram for the University. You may use the concept of keys, aggregation, generalisation, cardinality etc. in a proper way.
Question 2: (10 Marks)
Design the suitable RDBMS tables for the ER-diagram so created in question 1. The database design should include keys, foreign keys, constraints and referential integrity constraints.
Question 3: (10 Marks)
Implement the database design that you have created in question 2 using a RDBMS – our advice is that you choose either MySQL or MS ACCESS to do so.

Question 4: (10 Marks)
Create the following data entry form with suitable checks for the database so created.
a) Form for Entry of student information such as enrolment number, name, father’s name, date of birth, programme code (it should be from a list of valid programmes), year of programme, and draft number (for fee).
b) Form for entry of examination results of a course submitted by an examiner. It should be noted that the examiners are sent printed examination sheet called mark list for each subject. The mark list contains printed enrolment number and name of the students and a blank column for entering the marks. A mark list is sorted in the order of enrolment numbers.
Question 5: (10 Marks)
Enter at least 4 sets of records in each table. Enter marks directly in the tables except for the data that can be entered using the data entry form created in question 3.
Question 6: (10 Marks)
Create the following reports for the database you have created. The reports should have proper headings and page numbers and should include totals, if needed.
a) Create the list of students of a college. This list should be sorted in the order of programme and enrolment numbers in that programme.
b) Create an attendance list for a subject in a college.
c) Print the mark list of a subject that needs to be verified.
d) Create the result card for a student.

Question 7: (20 Marks)
Write and run the following SQL queries for your database:
a) Find the details of the programme having the maximum number of students.
b) Find the programme that has the maximum fee. Also find the number of students enrolled in this programme.
c) Find the student who have either failed the subject Database Management System at least once or has not given the examination for this subject. You may assume that this subject is taught in BCA 2nd Year and MCA 1st year.
d) Find the student who has topped in BCA 2nd Year examination.
e) Find the number of programmes run in each college.

Question 8: (20 Marks)
Design two views for the database that you have designed and implemented. One view should be for the University Vice Chancellor who is interested in knowing about the performance of students in various programme and colleges. The other view is for a student who can view only his/her information. Identify on what tables and what fields these two will be allowed to have access. Implement these views or write equivalent queries for the view defining expression using SQL.

Sunday, April 12, 2009

CS-65 Windows Programming

Course Code : CS-65
Course Title : Windows Programming
Assignment Number : BCA(4)-65/Assignment/2009
Maximum Marks : 25
Last Date of Submission : 30th April, 2009/ 30th October, 2009

Q. 1 (a) Explain the need of built-in functions in Visual Basic. List out the various
built in functions that are available in the latest version.
(3 marks)
(b) Explain how Multidimensional Arrays are used in a Visual Basic application.

A control array, a handy feature in VB, is a mechanism for quickly setting up a
number of controls of the same type (for example, an array of labels, text boxes,
etc.). Being of the same type, each control in the array has the same event
procedures. With the 32-bit version of VB the maximum number of controls in a
control array has risen to 32,767 from the 16,000 (approximately) allowed in the 16-
bit version. The final number for any particular project is also dependent on the
memory and system resources available.
Any individual control in the control array can be referenced using the same name -
an index is used to specify which of the particular controls you are interested in.
To set up a control array for your labels, create your first label by double-clicking on
the label icon in the toolbox. This will place a label in the middle of the form. Using
the right mouse button, click on the label and select the Properties option from the
cascading menu. Change the default Name property from its default value of Label1
to a more meaningful name, for example "lblFormInvoices" to identify the label as
belonging to the Invoice form.
Set those other properties that are always going to contain the same value for any
label on the form (for a consistent look and feel, all labels on the form should have a
similar appearance and structure). These properties would include appearance (flat
or 3D), back colour, and font attributes (name of font and size, font style, that is,
regular, italic, bold, underline, etc.). Finally, set the Caption property with a text
description that will be unique to this label.
Now when you want another label, click on this first label (sizing handles will appear
on its outline), and use the keyboard combination of Ctrl-C to copy it to the
clipboard. Use the keyboard combination of Ctrl-V to paste the new label onto the
form. When VB asks if you want to create a control array, click the "Yes" command
button. Click the new label, which is positioned in the top left corner of the form, and
drag it to its required location and resize it accordingly. Right click to set its Caption
There are many advantages to be gained from using the control array approach.
• You don't waste time thinking up individual names for label controls that you
have no intention of accessing from code. Some might argue that the same
result can be achieved by letting VB issue its default names of Label1, Label2,
Label3, etc. However, this control array method does provide more
meaningful names (without costing too much effort) that will make more
sense if you ever use a VB add-on product to cross-reference your
application's code.
• It means that you won't have to set the same properties each time you
generate a new label. The only property you will have to set is the Caption
• It saves on memory, arguably only a small amount but it all counts in large
• Because you know the number of controls in a control array, loop processing
can be used to simplify the code in your application. For example, the
following loop can be used to clear the contents of ten textboxes in a control
Dim i as Integer
For i = 0 to 9
txtInvoiceItem(i).Text = ""
Next i
Setting up text boxes in a control array also means that only one procedure call is
needed to verify text input, for example, to test that only alphabetic characters are
Looking for VB shareware?
The book Foundations of Visual Basic 4 for Windows 95 Programming comes with a
CD-ROM containimg more than 1,400 programs from EMS Professional Shareware.
There are custom controls, dynamic link library (DLL) samples, program utilities,
demonstrations of software, etc. The book itself contains a complete listing of the
shareware items plus the associated vendors and any costs that are involved.
The book, by Douglas Hergert, is published by IDG Books Worldwide.
Be careful with the End statement
For a demonstration of how misusing the End statement can unwittingly get any VB
programmer into trouble, set up a small sample VB project with one form. Now add
the following code to the form's event procedures:
Private Sub Form_QueryUnload
(Cancel As Integer,
UnloadMode As Integer)
MsgBox "In QueryUnload event"
End Sub
Private Sub Form_Terminate ()
MsgBox "In Terminate event"
End Sub
Private Sub Form_Unload
(Cancel As Integer)
MsgBox "In Unload event"
End Sub
Place a single command button on the form, name it cmdEnd, give it a caption of End, and code its
Click event as follows:
Private Sub cmdEnd_Click()
End Sub
Run the program and click the command button. The program simply ends and none of the code in
the form's events is executed.
Run the program again, but this time click on the icon situated in the extreme left of the title bar.
From the cascading menu select the Close option. Three dialog boxes (with the messages coded as
above) appear in the following order:
The program then ends.
As this is a simplistic program it does not matter which way the program ends.
However, in a real application, misuse of the End statement (by coding it a wrong
part of a multiform application) could cause the application to finish without vital
code first being executed.
Debugging such an application could turn into an expensive (and frustrating)
Experiment by replacing the End statement with a Stop statement to see what
happens. To find out the subtle differences between these two VB statements, an
explanation is provided on Page 112 of the Microsoft Visual Basic Programmer's
Guide (Version 4.0).
This chapter describes:
Math Functions Conversion Functions
String Functions
Date and Time Functions
Array Functions
Misc. Functions
Math Functions
Abs(vNumber) - Returns the absolute value of a specified number
Atn(vNumber) - Returns the arctangent of a specified number
Cos(vNumber) - Returns the cosine of a specified number (angle)
Exp(vPower) - Returns e raised to a power
Hex(vNumber) - Returns the hexadecimal value of a specified number
Int(vNumber) - Returns the integer part of a specified number
Fix(vNumber) - Returns the integer part of a specified number
Log(vNumber) - Returns the natural logarithm of a specified number
Oct(vNumber) - Returns the octal value of a specified number
Rnd() - Returns a random number less than 1 but greater or equal to 0
Sgn(vNumber) - Returns an integer that indicates the sign of a specified number
Sin(vNumber) - Returns the sine of a specified number (angle)
Sqr(vNumber) - Returns the square root of a specified number
Tan(vNumber) - Returns the tangent of a specified number (angle)
Conversion Functions
CBool(vVariant) - Converts an expression to a variant of subtype Boolean
CByte(vVariant) - Converts an expression to a variant of subtype Byte
CCur(vVariant) - Converts an expression to a variant of subtype Currency
CDate(vVariant) - Converts a valid date and time expression to the variant of subtype
CDbl(vVariant) - Converts an expression to a variant of subtype Double
CInt(vVariant) - Converts an expression to a variant of subtype Integer
CLng(vVariant) - Converts an expression to a variant of subtype Long
CSng(vVariant) - Converts an expression to a variant of subtype Single
CStr(vVariant) - Converts an expression to a variant of subtype String

Q. 2 (a) Explain the Chart control and Grid control in Visual Basic.
(b) Explain the advantages of using control arrays in Visual Basic

Microsoft Chart - A How To Guide For Handling The VB 6 Charting Beast
Lesson 1.
Microsoft Chart is one of the many controls that is bundled in the Professional Edition
of Visual Basic and with 190 methods and properties, you would imagine it to be one
of the best. If you really want the current state of the art in graphs, you had better
think twice as you may be heading up a dead end. This article explains why it is a
tool that can bring good results as long as you keep your enthusiasm under control.
After spending a number of years manipulating MS Graph in Microsoft Access and
Excel, I was called in to make the Microsoft Chart control work for a VB program with
over 3000 end users. They had converted their product over to VB 5 and had made a
decision to replace their aging 3rd Party graph control with MS Chart. I came in with
little knowledge of MS Chart and assumed that MS Graph would be similar quality
products. Well the only real similarities are that they are both complicated and they
both come with really poor help for programmers. The MS Office Graph Active X
object is far more visually appealing and feature rich. See Sidebar.
My task though was to make MSChart look professional and work with visual basic.
This article outlines a few changes that make MSChart look a lot better than it is
when you first add it to your forms.
Know MSChart's Limitations
Before committing yourself to MS Chart, check that it will provide the graphical look
that you and your users will find acceptable. If you end up discovering this 3 weeks
after you start, you will simply have to throw away the code away as it will unlikely
be reusable with any other 3rd part graphing tool.
The best way to quickly find out about the appearance of MSChart is to add a new
chart to a form and open up the property pages. Now experiment with the different
features in using the Chart Tab.
You Need Help (and you will be lucky to get it)
Microsoft Chart comes with volumes of help in MSDN and 95% of it is useless. Here is
an example of the help that you get for the chart legend property
"Returns a reference to a Legend object that contains information about the appearance
and behavior of the graphical key and accompanying text that describes the chart series.
Syntax object.Legend
The object placeholder represents an object expression that evaluates to an object in the
Applies To list."
There are no links to any useful examples and very few full examples in the help
system. So the only assistance that you can really get is VB IntelliSense. This gives
you all the methods and a lot of constants and it really is a hit and miss exercise. But
even IntelliSense comes up with some beautiful long winded statements like that
which is required to turn off the grids on the chart.
Mschart1.Plot.Axis(VtChAxisIdX).AxisGrid.MajorPen.Style = VtPenStyleNull
Getting Started
Click on your components bar and select Microsoft Chart Control (Called
mschart.ocx). You will need to have Visual Basic for Professionals as MSChart does
not come in the Learners Edition. At this stage you might try setting up a
demonstration install kit run to see that the object installs on representative end
users systems.
Making The Graph Look Better (Manually)
Before you start programming the charts, you can make the charts look better by
changing the following items. These are my preferences and naturally are open to
opinion. It would be a good idea to write down any changes that you make to your
graphs manually as you probably should do the same in your startup code.
Tip 1 : Put a border on the bars. You do this by right clicking on the MSChart object
and choosing properties.
Select series color and for C1 change edge color to black. Do this for the first four
colors. The default setting is the same color as the bar which gives it no definition.
Figure 1 - Use the property pages to change the edge color to black
Tip 2 : Select Axis Grid in the property pages. Set the Style to NULL for the X Axis, Y
axis and Secondary Y Axis.
Tip 3 : Using Excel as a benchmark, select the fonts properties and set the following
Axis Labels - Arial 9 or 10 Regular
Title - Arial 10 or 12 Bold
Tip 4 : At this stage you may want to manually change the chart type using the
Chart Tab.
Tip 5 : Finally change the background color to white by selecting Backdrop and
defining the background Pattern to be full shade rather than null.
VB 5 & 6 Microsoft Chart - Initializing The Chart (Lesson 2)
The Demonstration Software
The accompanying resource file contains a VB 5 project called GRChart. This project
will show you how to program a number of the key elements that you need to make
MS Chart a smarter object. The code is separated into local form specific code and
some general code that you can use for any MSChart object.

Figure 2 - GRChart Project up and running
Initializing The Settings
We should establish an initialization subroutine to preset these graph startup
sequences every time we open the chart object. You need to do this to ensure that
you have the same look and feel in your graphs every time. Before calling the
startup settings, reset the chart to avoid any surprises using
And add the data to the graph so that it has all the series internally stored. This is
important as the settings subroutine (called FX_ResetMSChart) needs to establish
the extent of new data.
Dim numSeries As Integer
With MyChart
.chartType = VtChChartType2dBar
' Establish the number of items in the group
numSeries = .Plot.SeriesCollection.Count
' Add a black line border of each of the shapes
For iCount = 1 To numSeries
.Plot.SeriesCollection(iCount).DataPoints(-1).EdgePen.VtColor.Set 0, 0, 0
Next iCount
' Turn off the background grids
.Plot.Axis(VtChAxisIdX).AxisGrid.MajorPen.Style = VtPenStyleNull
.Plot.Axis(VtChAxisIdY).AxisGrid.MajorPen.Style = VtPenStyleNull
.Plot.Axis(VtChAxisIdY2).AxisGrid.MajorPen.Style = VtPenStyleNull
.Plot.Wall.Pen.Style = VtPenStyleNull
' Define the background color to white
.Backdrop.Fill.Brush.FillColor.Set 255, 255, 255
.Backdrop.Fill.Style = VtFillStyleBrush
End With

VB 5 & 6 Chart - Getting Data Into The Chart (Lesson 3)
There are a number of ways that you can get data into the Chart control and they basically involve passing
a column of labels and a number of columns of numbers to the chart control. The chart control then places
these in a spreadsheet like container called a datagrid that you can only access using visual basic. The
specific methods that you can use are
For this article, I will illustrate how you can add an array to MSChart. In this example, I am going to pass 6
different variables to the chart for 8 monthly periods. When testing your control, use more than the 4
variables to make sure that your initial settings routine is working well.
imax = 6
Dim X() As Variant
Dim iRow As Integer
ReDim X(1 To 8, 1 To imax + 1)
dataScale = 1
iRow = 1
X(1, iRow) = "Period"
X(2, iRow) = "June 1998"
X(8, iRow) = "June 2004"
For iRow = 2 To imax + 1
X(1, iRow) = "Ann Depr%" & iRow
X(2, iRow) = (12.2 + (iRow * Rnd) * 20) * dataScale
X(3, iRow) = (45 + (iRow * Rnd) * 20) * dataScale
X(8, iRow) = (16 + (iRow * Rnd) * 20) * dataScale
Next iRow
' Reset the chart back to default to avoid surprises
' Pass the chart object reference and array to sub
Call addDataArray(MSChart1, X(), True)
The shared subroutine then adds the data to chart using the following
MyChart.ChartData = X
VB 5 & 6 Chart - Titles and Legends (Lesson 4)
Most users have had a lot of experience with high quality graphs through
spreadsheets like Excel and Lotus so the pressure is on to add some more
information to your graph. The first thing you might do is add a title. Some of the
relevant methods for handling titles are as follows.
.Title.Text = TitleVar
.Title.VtFont.Name = "Arial"
.Title.VtFont.Size = 12
.Plot.AutoLayout = True
.Title.Location.LocationType = VtChLocationTypeTop
end with
and if you wish to turn the Title off
MSCHART1.Title.Text = ""
For displaying the legend, the following methods will display the legend at the top of
the screen
With MSCHART1.Legend
.Location.Visible = True
.VtFont.Name = "Arial"
.VtFont.Size = 8
.Location.LocationType = VtChLocationTypeTop
.VtFont.Effect = VtFontStyleBold
end with
The simultaneous display of title and legend demonstrates a problem with Chart. The
layout is very difficult to control. In this case the title starts taking up a lot of
valuable acreage on the chart. The other big problem that occurs is where one
programmable event effects an other. This occurs if you want to show the Title and
Legend at the one time in a place of your own choice. The resultant graph positions
can at sometimes be uncontrollable and you will end up chasing methods and events
all over the place.
So my recommendation is to avoid the title and show the legend at the top. That
way the legend acts as a definitive title and you do not have to provide additional
code to generate the title. On large charts, it is quite feasible to show both the title
and and legend at the same time.
VB Chart - Lines, Bars, 3D, Stacked Bars and Area Graphs (Lesson 5)
Microsoft graph gives you the ability to come up with a number of different graph
types and I have included an option bar in my demo to demonstrate them. The way
that you change graph types using visual basic is easier than most chart methods
and I illustrate three examples
With MSChart1
chartStr = graphType1(Index).Caption
Select Case chartStr
Case Is = "2D Area"
.chartType = VtChChartType2dArea
.Stacking = True
Case Is = "2D Bar"
.chartType = VtChChartType2dBar
.Stacking = False
Case Is = "3D Bar"
.chartType = VtChSeriesType3dBar
.Plot.Projection = VtProjectionTypeOblique
.Stacking = True
end select
end with
Now I have to stick my neck out here and tell you what I think about the different
chart types that are available in MSCHART. The two dimensional Vertical Bar, Line,
Stacked Bar and Area graphs are all quite acceptable. The other 2D graphs such as
Pie, Radar and Scatter are quite quirky and would only suit a small number of
The 3 Dimensional Graphs are very poor and only work if your chart control is Large
and Square in shape. Figure 3 shows the very best that you can achieve with 3D
graphs. Note the terrible display of the Series Titles at the bottom of the graph. Now
if you put this into a rectangular shape, you still get a Square display which can look
really bad. So my tip if you want perfect 3D graphs, look for a third part control.
Figure 3 - Illustration Of The 3 Dimensional Features Of MS Chart
VB 5 & 6 Chart - A Summary and An Alternative (Lesson 6)
MSChart is not the best looking graphing product that is available on the market. If
you limit the amount of vb that your write and you do not want 3D graphs, it is
probably a reasonable place to start graphing. Visual basic 6 edition now supports
ADO record sources so that you can get you valuable data into the control and start
visualizing your group by queries quite quickly. The source code that I have provided
in the demonstration database is probably approaching the maximum amount of
code that you should invest in manipulating the control. If you are going to spend a
lot of time programming the control, try MS Graph that comes with Office or have a
look at the alternatives 3rd Party Controls on the market.
About The Author
Garry Robinson runs a software development company called GR-FX based in
Sydney, Australia. Recently he has written a number of articles for Smart Access on
topics such as Consolidating Data Using Queries, Manipulating MS Graph with Access
and using Access to Automated your E-mail. He developed a popular shareware data
mining tool that will allow you to drilldown on data in any linked backend database
and then to visualize that data in 2 or 3D using MS Graph. He also runs a VB
resources page at
Alternatively add MS Graph That Comes With Office"
Visually the Office Graph object is far more professional looking than Microsoft Chart.
To add MS Graph to your project, you need only have a registered copy of any of the
Office Products. To get started, on the VB components Toolbar, select the OLE
button and draw a square on your form with your mouse where you want to place
the graph object. Release the mouse and choose either the Microsoft Graph 97
Chart, or the Excel Chart. This will add the OLE/Active X object to your project. If
you are developing for a single organisation that runs Office on all the target users,
this is probably the best visual solution that you can provide your end users. To
support this article, I have written a series of lessons on how to deploy MSGraph
with visual basic available from
That the end of the VB Chart Lessons !!!

Q. 3 Create a form named “welcome” which asks the user for the name, and address then says "Hello Mr./ Miss: " your address is:
. The user is then given a choice (with option buttons) of changing font type and font size of and
as per the option selected. This form should stop by clicking on a Command Button named Exit.

Dim a(5) As String
Dim rollno(5) As Integer
Private Sub Combo1_Click()
Dim i As Integer
'Text2.Text = Combo1.Text
For i = 0 To 2
If Combo1.Text = a(i) Then
Text1.Text = rollno(i)
End If
End Sub
Private Sub Combo2_Click()
Dim i As Integer
'Text2.Text = Combo1.Text
For i = 0 To 2
If Combo2.Text = rollno(i) Then
Text1.Text = a(i)
End If
End Sub
Private Sub Command1_Click()
End Sub
Private Sub Form_Load()
a(0) = "anju"
a(1) = "ram"
a(2) = "suman"
rollno(0) = "14"
rollno(1) = "13"
rollno(2) = "12"
rollno(3) = "11"
For i = 0 To 2
Combo1.AddItem (a(i))
Combo2.AddItem (rollno(i))
Next i
End Sub

Q. 4 Build a form with two drop down lists (combo boxes type 0), one for Name and the other for RollNumber of the students in your batch. When this form is loaded fill the lists from the arrays. If the user pulls down one of the lists and clicks on a Name(or Roll Number) the corresponding RollNumber (or Name) is displayed in the text box of the other list.

Private Sub Command1_Click()
a = Text1.Text
b = Text2.Text
Label1.Caption = "welcome"
Label4.Caption = "hello mr/miss :" & a & "is" & b
End Sub
Private Sub Command2_Click()
End If
End Sub
Private Sub Option1_Click()
Text1.Font = Option1.Font
Text2.Font = Option1.Font
End Sub
Private Sub Option2_Click()
Text1.FontSize = Option2.FontSize
End Sub,

Q. 5 Create a form using Labels to display system date and time in appropriate form, font and color.

Private Sub Form_Load()
Label1.Caption = DateTime.Now
Label1.Font = "Arial Black"
End Sub
Ans 1
Visual Basic Multidimensional Arrays
A multidimensional Visual Basic array is nothing more than an array in which each array
element is itself an array. A two dimensional array, for example, can be thought of as a
table, where each element in the parent array represents a row of the table and the
elements of each child array represent the columns of the row. In fact, Visual Basic does
not limit an array to two dimensions - up to 32 dimensions are supported
[edit] Creating a Visual Basic Multidimensional Array
Continuing our table analogy, declaring a multidimensional array requires that both the
number of rows and columns be defined when the array is created. As with standard
arrays, multidimensional arrays are declared using the Dim keyword:
Dim strBooks(4, 2) As String
The above Visual Basic code excerpt creates a two dimensional String array of 5 rows
and 2 columns.
[edit] Assigning Values to Multidimensional Array Elements
Values are assigned to array elements by specifying the index into each dimension. For
example, in a two dimensional array, 0, 0 will references the element in the first column
of the first row of the array. The following code initializes each element of our array:
Dim strBooks(4, 1) As String
strBooks (0, 0) = "Learning Visual Basic"
strBooks (0, 1) = "John Smith"
strBooks (1, 0) = "Visual Basic in 1 Week"
strBooks (1, 1) = "Bill White"
strBooks (2, 0) = "Everything about Visual Basic"
strBooks (2, 1) = "Mary Green"
strBooks (3, 0) = "Programming Made Easy"
strBooks (3, 1) = "Mark Wilson"
strBooks (4, 0) = "Visual Basic 101"
strBooks (4, 1) = "Alan Woods"
The above example creates a two dimensional array of 5 rows (remember that indexing
starts at 0 so this array have elements from 0 to 4 inclusive) and two columns. Column 1
is the book title and column 2 the author.
[edit] Accessing Elements of a Multidimensional Array
Array element are accessed using the same technique as that used to assign values to
elements, by specifying the index into each dimension. The following example uses a
nested For loop to iterate through a two dimensional array and display each element in a
For intCount1 = 0 To 4
For intCount2 = 0 To 1
MessageBox.Show(strBooks(intCount1, intCount2))
Next intCount2
Next intCount1
A similar approach can be used to iterate through the element of a three dimensional
Visual Basic Array:
For intCount1 = 0 To 5
For intCount2 = 0 To 4
For intCount3 = 0 To 1
MessageBox.Show(strBooks(intCount1, intCount2,
Next intCount3
Next intCount2
Next intCount1